Any way to update labels after rendering the chart?

96 views
Skip to first unread message

Uday Shankar

unread,
Feb 18, 2017, 12:43:45 AM2/18/17
to JavaScript InfoVis Toolkit
I have a checkbox on my UI, which the user can check to include more information in the labels displayed. Which means, once the chart is rendered I am trying to iterate through all the labels and change its values... I tried something like this -

st.graph.eachNode(function(node) {
   node
.setLabelData('innerHTML', 'NEWLABEL');
   node
.Node.color = "#000";
   node
.Node.border = "10px";
});


I couldn't get this to work. :(

.Uday

Hamann

unread,
Feb 19, 2017, 6:09:27 AM2/19/17
to JavaScript InfoVis Toolkit
This is the basic structure to do something with node and edge

jit.Graph.Util.eachNode(rgraph.graph, function(flt) {

// do something with your node label
// see documentation setDataset or setData
$jit.Graph.Util.eachAdjacency(flt, function(lbl) {

// do something with edgeLabels
setLabelDate or setLabelDataSet

});
});
after that you have to refresh
like 
rgraph.refresh()

good luck ;)


Op zaterdag 18 februari 2017 06:43:45 UTC+1 schreef Uday Shankar:

Uday Shankar

unread,
Feb 20, 2017, 3:40:53 PM2/20/17
to JavaScript InfoVis Toolkit
Thanks! I'll try this out...
Reply all
Reply to author
Forward
0 new messages