Hi.
Well it depends on what exactly do you want to achieve?
Such property "url" doesn't exist on node style object.
My guess is that you probably want to open URL when clicked on the node.
To do that you need to do the following:
Add "extra" object to the node. Extra should contain "url" or any other parameters you wish to add. The "extra" object makes sure that properties there won't be reserved or overwritten.
{"id": "....", "loaded": true, "style": {....}, "extra": { "url": "Your URL"}}
Add event handler.
By default NetChart won't open URL. You have to actually tell NetChart what to do and when to do it. For example open URL on double click or single click. To open it on the new tab or not.
And finally something like this should work:
var data = {
"nodes":[
{"id":"n1", "loaded":true, "style":{ "fillColor": "rgba(236,46,46,0.8)", "label":"Node1"},"extra": {"url": "https://zoomcharts.com"}},
{"id":"n2", "loaded":true, "style":{ "fillColor": "rgba(47,195,47,0.8)", "label":"Node2"}, "extra": {"url": "https://zoomcharts.com"}},
{"id":"n3", "loaded":true, "style":{ "fillColor": "rgba(28,124,213,0.8)", "label":"Node3"}, "extra": {"url": "https://zoomcharts.com"}}
],
"links":[
{"id":"l1","from":"n1", "to":"n2", "style":{"fillColor":"rgba(236,46,46,1)", "toDecoration":"arrow"}},
{"id":"l2","from":"n2", "to":"n3", "style":{"fillColor":"rgba(47,195,47,1)", "toDecoration":"arrow"}},
{"id":"l3","from":"n3", "to":"n1", "style":{"fillColor":"rgba(28,124,213,1)", "toDecoration":"arrow"}}
]
};
var t = new NetChart({
container: document.getElementById("demo"),
area: { height: 350 },
data: { preloaded: data },
events: {
onClick: function(ev, args) {
if(args.clickNode) {
var n = args.clickNode;
if(n.data.extra && n.data.extra.url) {
window.location.href = n.data.extra;
}
}
}
}
});