Chartjs-Using legend onClick default function in custom onClick function in ChartJs

1👍

I finally managed to solve it. It seems "chart.defaults.plugins.legend.onClick" its outdated. What "onClick" func really does is this:

    legend.chart.toggleDataVisibility(legendItem.index);
    legend.chart.update();

So I copy this lines and pasted inside options.plugins.legend.onClick

Leave a comment