score:2

Accepted answer

if chart1 is a global variable, you can do:

window['chart'+id].series[0].update(...);

because global variables are automatically turned into properties of the window object.

if it's not a global variable, you can't do this. it would be best to make chart an array, rather than having chart1, chart2, etc. then you could do:

chart[id].series[0].update(...);

Related Query

More Query from same tag