Dear Highstock tech support team,
In the application I am building, my team implemented dynamic adding and removing of PlotLines by using YAxis.addPlotine() and PlotLine.destroy(), which seemed to be working as expected. However, after implementing other unrelated features, we noticed that some API methods to update the chart (for example, YAxis.update()) would, as a side effect, show all previously destroyed PlotLines.
After some debugging, I understand that all the PlotLines are cached in chart.userOptions.plotLines even after calling PlotLine.destroy(), but I do not know whether this is a bug or intended behavior.
Here is a simplified demo of my problem:
https://stackblitz.com/github/francisco ... harts-demo
The problem can be seen by following these steps:
click 'Add Line' 3 times
click 'Remove Line' 2 times
click 'Update Y Axis Options'
The lines that were removed are now rendered again in the chart.
Help would be much appreciated.
Best regards,
Francisco