I have a problem to dynamically rename the series after chart load. It's working at first but when I press one of the range selector's grouping button (by week, by month, by year) the default names (Series 1, Series 2 etc) reappears.
I have tried this:
Code: Select all
let arr = ['Montreal', 'Boston', 'Paris', 'Tokyo', 'New York'];
for (var i = 0; i < arr.length; i++) {
chart.series[i].name = arr[i];
}
chart.reflow();
and with chart.update like this:
Code: Select all
let arr = ['Montreal', 'Boston', 'Paris', 'Tokyo', 'New York'];
chart.update({
chart: {
events: {
redraw: function() {
for (var i = 0; i < arr.length; i++) {
this.series[i].name = arr[i];
}
}
}
},
});
chart.reflow();
Can you see what I'm doing wrong?
Thank you for all your good support!