leeoniya / uPlot

📈 A small, fast chart for time series, lines, areas, ohlc & bars
MIT License
8.83k stars 386 forks source link

adding and removing series with Y-axis #979

Closed builder555 closed 3 months ago

builder555 commented 4 months ago

I understand I can add series with .addSeries() method and delete with .delSeries(), however I'm wondering if it's possible to add series with its own Y axis and remove it, taking its Y axis with it as well? I haven't found a way to do it other than doing the .destroy() and then new uPlot() again.

leeoniya commented 4 months ago

uplot will auto-hide axes when there are no series on their scales. so you can initially configure the additional axis and scale and add/remove series later that use this scale.