How do I get a reference to a dygraph based on Div ID it was assigned to?

StackOverflow https://stackoverflow.com/questions/18922776

  •  29-06-2022
  •  | 
  •  

문제

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

도움이 되었습니까?

해결책

No, you'll have to maintain the mapping yourself.

var dygraphs = {};
dygraphs['chartxyz'] = new Dygraph(document.getElementById("chartxyz"), .....)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top