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

chart.hide(datasetIndex, dataIndex) not hiding bar #11450

Closed
Offbeatmammal opened this issue Aug 17, 2023 · 3 comments · Fixed by #11755
Closed

chart.hide(datasetIndex, dataIndex) not hiding bar #11450

Offbeatmammal opened this issue Aug 17, 2023 · 3 comments · Fixed by #11755

Comments

@Offbeatmammal
Copy link

Expected behavior

per the docs, using chart.hide(0,3) should hide the third item in the first dataset

Current behavior

currently while chart.hide(0) correctly hides the dataset, chart.hide(0,3) seems to have no effect on a bar chart.

for a line chart it does remove the point, but doesn't reflow the line (still goes through the point)

Reproducible sample

https://codepen.io/offbeatmammal/pen/vYvBaav

Optional extra steps/info to reproduce

No response

Possible solution

No response

Context

I may be missing the intent of this function (in which case this may be better as a feature request) but I would like to be able to (temporarily) toggle individual items in a dataset on/off (eg when showing a list of countries toggle to only show German speaking ones) without having to splice and restore the datapoints

chart.js version

4.3.2

Browser name and version

No response

Link to your project

No response

@isafux
Copy link

isafux commented Feb 13, 2024

This bug also exists exactly as described in newer chart.js version 4.4.1.
A fix would very much be appreciated.

@EricWittrock
Copy link
Contributor

If no one else is already, I will work on this issue.

@LecyQ
Copy link

LecyQ commented May 14, 2024

I tried this but still does not hide the data. Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants