I want to use dynamic chart names while using setExtremes
(like chart1, chart2, chart3).
Instead of the below line as chart1
chart1.yAxis[0].setExtremes(min, max); // which works fine if used
I use the below line in order to have a dynamic chart name. But says properties of undefined.
'chart' + idconvertedtostr.yAxis[0].setExtremes(min, max); // does not work
'chart' + idconvertedtostr
is not recognized as 'chart1'
. What is wrong here?
My Code:
ID = parseInt(elem.getAttribute('id'))
var idconvertedtostr = ID.toString();
console.log("ID", ID) // returns 1
console.log("join", 'chart' + idconvertedtostr) // returns chart1
'chart' + idconvertedtostr.yAxis[0].setExtremes(min, max); // throws error, not recognized as chart1.setExtremes(min, max)