1👍
✅
Apparently, the way to fix this was instead of using the variable chart in addData(), use window[chartname + index]
when manipulating dynamically created charts. I found this out by trying to point to the chart by using both eval() and window[]. Eval didn’t work at all, but Window did the trick.
Example:
var number = 1;
window['linechart' + number];
This will call chart linechart1.
Source:stackexchange.com