mxgraph custom vertex as image

javascript jgraph mxgraph

582 просмотра

1 ответ

906 Репутация автора

Can someone point me where/how to set the vertex to image? I want the shape to be similar to the icon I dragged/dropped in the graph. At the moment when I drag/drop icon on the graph its just showing a rect shape.

toolbar icon

<add as="Customers" template="customers" icon=".../getCustomers.png" style="customer;image=images/dude3.png"/> <br/> <br/>

<add as="customers">
        <add as="customers" value="1"/>
        <add as="fillColor" value="#93C47D"/> <!--shape color-->

I tried adding shape and imagePath but that didn't work.

<add as="shape" value="imagePath"/>
Автор: nCore Источник Размещён: 18.07.2016 04:12

Ответы (1)

0 плюса

6499 Репутация автора

Needs an image:

<add as="imageCell">
    <add as="shape" value="image"/>
    <add as="perimeter" value="rectanglePerimeter"/>
    <add as="fontSize" value="10"/>
    <add as="align" value="center"/>
    <add as="verticalAlign" value="middle"/>
    <add as="image" value="images/draw/mxlogo.jpg"/>
Автор: David Размещён: 27.10.2016 11:55