I am using anychart with the below data but for me only the last edge is getting visible everytime. I dont get what is the issue.
All the edges should be visible
anychart.onDocumentReady(function ()
{
// create data
const data = {
nodes: [
{ id: "[email protected]", x: 100, y: 100 },
{ id: "[email protected]", x: 100, y: 200 },
{ id: "[email protected]", x: 200, y: 100 },
{ id: "[email protected]", x: 200, y: 200 },
{ id: "[email protected]", x: 300, y: 100 }
],
edges: [
{ id: '', from: '[email protected]', to: '[email protected]' },
{ id: '', from: '[email protected]', to: '[email protected]'},
{ id: '', from: '[email protected]', to: '[email protected]' },
{ id: '', from: '[email protected]', to: '[email protected]' }
]
};
// create a chart and set the data
const chart = anychart.graph(data);
// set chart layout
chart.layout().type("fixed");
// set chart title
chart.title("Network Graph: Basic Sample");
// set container id
chart.container("container");
// draw chart
chart.draw();
});
All the edges should be visibible
Solution # 1
Set a unique identifier for each edge. In your example, all of them have an empty string as the identifier, so only the last one will take effect. This is why only one is displayed, as you used only one identifier.
Wrong
Successfully
Solution # 2
By the way, specifying an ID is not required. If you don't provide one, AnyChart automatically assigns different IDs to all edges by default.
Successfully
Example