I'm using Chart.js and I want to remove labels with percentage marked with red circle on image below.
I'm using this code to produce this chart:
const options = {
responsive: true,
title: {
display: false
},
legend: {
display: false
},
tooltips: {
mode: 'index',
intersect: true
},
scales: {
yAxes: [{
type: 'linear',
position: 'left',
id: 'y-axis-1'
}, {
type: 'linear',
position: 'right',
id: 'y-axis-2',
gridLines: {
drawOnChartArea: false
}
}],
}
};
new Chart(document.getElementById('originalThirdChart').getContext('2d'), {
type: 'bar',
data: data,
options: options
});
How can I do this? Thanks in advance!
If you want to remove only the percentages, just add this line in your options
labels: { render: () => {} }
It will look like:
options: {
plugins: {
labels: {
render: () => {}
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With