I am encountering an issue with my chart that is reloaded periodically. I want to make sure that the series hidden by the user (by clicking on their legend names) remain hidden even after reloading. I attempted to set the series initiallyHidden attribute to a saved value on reload, but it doesn't seem to be effective.
Here is the line of code that I used to set the attribute in the AJAX callback responsible for fetching the current data and loading it into the chart:
widget.ChartData.dataset[seriesIndex].initiallyHidden = widget.settings.initiallyHidden[seriesIndex];
The value
widget.settings.initiallyHidden[seriesIndex]
is what my event handler saves when the user clicks on the legend name. However, even when it is set to "1", the series still becomes visible upon reload.
I would appreciate it if someone could point out any mistakes I might be making.