Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I hide series depending on the Zoom scale ? #43

Open
citron opened this issue May 16, 2022 · 2 comments
Open

How can I hide series depending on the Zoom scale ? #43

citron opened this issue May 16, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@citron
Copy link

citron commented May 16, 2022

I plot 10 series but I want to hide some ( but not all ) depending on the zoom scale.
I have tried using dispose() then instantiate a new chart but the chart is not displayed even if I can find the right series in chart._options
Maybe there is a better alternative than dispose then redraw.
What would you please suggest ?
Thank you very much for TimeChart.js

@huww98 huww98 added the enhancement New feature or request label May 18, 2022
@huww98
Copy link
Owner

huww98 commented May 18, 2022

I have tried using dispose() then instantiate a new chart but the chart is not displayed

This is the current limitation. The data array records whether the data have been uploaded to GPU, and this info would not be disposed with the chart instance. So you cannot use the same array with multiple chart instances currently. I plan to eliminate this limitation in the future.

Maybe there is a better alternative than dispose then redraw.

Ideally, I would like to support just removing series from chart.options.series, e.g. with .filter(...). I have not tested it, it probably would not work now.

@huww98
Copy link
Owner

huww98 commented Sep 20, 2022

Reviewing this issue. Can you just set the series to invisible instead of really remove it?

https://github.com/huww98/TimeChart#series-options We have a “visible” option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants