-
I'm trying to migrate from v2.9.4 to v3.0.2. In v2 I was able to hide a dataset for a dougnut with the following code: However this is not working in v3 (label is not available anymore in the data property);
It also seems that the hidden property is no longer available for the data property. How can this be done in v3? I know removing is possible with this code, but not sure how to hide/show (toggle) data.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
See https://www.chartjs.org/docs/latest/developers/api.html#toggledatavisibility-index let indexLabel = chart.data.labels.findIndex(x => x === labelName)
chart.toggleDataVisibility(indexLabel); |
Beta Was this translation helpful? Give feedback.
See https://www.chartjs.org/docs/latest/developers/api.html#toggledatavisibility-index