I am unable to hide the legend in the pie chart i am displaying in my app. I am setting the display option in the chart options to false
and it is still not hidden. See snippet below:
Code: Select all
const getPieChartOptions = () => {
const textColor = getComputedStyle(document.body).getPropertyValue('--text-color') || 'rgba(0, 0, 0, 0.87)';
const fontFamily = getComputedStyle(document.body).getPropertyValue('--font-family');
return {
plugins: {
legend: {
display: false,
labels: {
font: {
family: fontFamily,
},
color: textColor
}
}
}
};
};