Add & edit Nodes | |||
You can interactively add a node in an existing chart. To avail this feature you need to render the chart in edit mode » Edit mode can be enabled setting viewMode='0' in <chart> element. You can also edit an existing node or delete a node if required. In this page we will see how these can be achieved. For this, let's take the basic chart, as shown below, which we have created in the previous page. Upon this, we will add a node with text "My new Node" to this chart. Adding a node at run-time When in edit mode, the end user can add a node by right-clicking on a position over the chart where the node is to be placed and then selecting "Add a node" option from the context menu.
This presents a dialog box, as shown above, to enter the following node information:
The various configurable options are shown in the images below: When the users now click Submit, they will see the new node as shown below: You can define nodes in chart data too. Each node is defined in the data of the chart through the <set> element of the <dataset> element. | |||
Editing a node at run-time | |||
In edit mode, the end user can edit an existing node which is either created using the data provided to the chart while rendering/updating or created at run-time. To edit a node, right-click on the node and select "Edit Node" option from the context menu. This again presents a dialog box with all major configurable options for the node. We did some more changes and clicked Submit. The node will get updated with new configurations after Submit is clicked. Using the Edit dialog box you cannot edit the dataset name, change the id, change the shape type and image options remain disabled (whether applied or not). You can configure rest of the settings. |
|||
Deleting a node at run-time | |||
In edit mode, the end user can delete a node by right-clicking on a node and then selecting "Delete Node". The node and its attached connectors would then be deleted, as shown below: |
|||
You can get the latest updated node positions using JavaScript or by submitting the updated positions to a server-side script. |