I am trying to remove the label entirely from the chart when all the values in the dataset are zero and it appears blank with labels as there is no point of showing it. Tried different ways but wasn't able to achieve it.
From the below screenshot I want just display "Wed, Fri and Mon" which have data and remove the rest.
For example: In the below data we have all zero's for Saturday and I do not want to show Sat on the chart with just empty/no stacked bar.
const labels = [Mon, Tue, Wed, Thu, Fri, Sat, Sun] // Can be 7 days or 14 days
const data = {
labels: labels,
datasets: [
{
label: 'Dataset 1',
data: [25,40,4,60,0,43],
backgroundColor: red
},
{
label: 'Dataset 2',
data: [20,4,30,40,0,43],
backgroundColor: blue
},
{
label: 'Dataset 3',
data: [2,4,4,100,0,43],
backgroundColor: green
},
]
};