Reputation: 1257
The chartjs feature to show/hide a dataset by clicking on the legend is really nice. Is it possible to achieve the same but clicking on for instance a checkbox outside the chart canvas?
Upvotes: 0
Views: 4465
Reputation: 1257
This should do the trick
chart.data.datasets.forEach(function(e) {
e.hidden = true;
});
Upvotes: 4