Skip to content

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

Closed
@Offbeatmammal

Description

@Offbeatmammal

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions