score:9

Accepted answer

the problem is that you have only one dataset and your code use the index of legend item clicked to hide datasets[index].

on the contrary you need to hide single item data as below:

var meta = chart.getdatasetmeta(0);
var item = meta.data[index];

check the fiddle updated: https://jsfiddle.net/beaver71/aa2n39s2/


Related Query

More Query from same tag