Reputation: 590
Is there a way to get a reference to the graph via the div id it was placed in?
new Dygraph(document.getElementById("chartxyz"),.....)
Since that wasnt stored to a var, (or even it if was, but i try to access it from another script)
is there a way i can get a dygraph object via that div id of chartxyz? I'd like to run the setSelection on it to highlight a series.
Thanks
Upvotes: 3
Views: 1366
Reputation: 16945
No, you'll have to maintain the mapping yourself.
var dygraphs = {};
dygraphs['chartxyz'] = new Dygraph(document.getElementById("chartxyz"), .....)
Upvotes: 4