Skip to content

doughnut hide dataset by legend name (v3) #8855

Answered by kurkle
muss0v asked this question in Q&A
Discussion options

You must be logged in to vote

See https://www.chartjs.org/docs/latest/developers/api.html#toggledatavisibility-index

let indexLabel = chart.data.labels.findIndex(x => x === labelName)
chart.toggleDataVisibility(indexLabel);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@muss0v
Comment options

Answer selected by muss0v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #8854 on April 08, 2021 14:43.