The initial hidden status of a dataset is always null
datasets: [{
data: [10, 15, 30, 40],
hidden: true
}]
Go to:
https://jsfiddle.net/aLw73xaj/
open the console and click on run.
You will see that the initial status null
.
Click on the legend to toggle the status and click on the button “log hidden status” to show the new status false
in the console.
Repeat this and the status should be back to null
.
Change datasets[].hidden
to true
and repeat the step above.
Expected behavior: chart.getDatasetMeta(index).hidden
should be always true
or false
, but never ever null
.
chart.getDatasetMeta(index).hidden
is an internal and you should not interact with it directly. If you need to know if a dataset is visible, you should callchart.isDatasetVisible(index)
instead.