Open junaid-md opened 2 years ago
I've made it by adding in options.plugins.datalabels: datalabels: { display: function (context) { return context.dataIndex === 0; } }
@junaid-md maybe I'm wrong but this could be a topic for CHART.JS project https://github.com/chartjs/Chart.js and not datalabels.
If I understood well your use case, you would like to hide the ticks on time axis when the value is 0.
You could use the ticks callback
.
I am trying to hide the dates below where the the dataset is all zero's for a particular label. Tried it with different things but unable to get my mind through it. Can anyone help? From the screenshot I want just to display the Wed, Fri and Monday in the chart and remove the rest which have all zeros.