I was having some problem with chart.js legend. The legend with long text took up too much spaces which resulting in the reduce in the size of my pie chart:
Another
First off, set canvas's width and height using it's native attributes (do not use style attribute), like so :
note: width should be twice the height
Then, set responsive property to false in your chart options, as such :
options: {
responsive: false,
...
}
ᴅᴇᴍᴏ
var chart = new Chart(brandChart, {
type: 'doughnut',
data: {
labels: ['Etronin Home Appliances Service & trading Pte Ltd', 'Giant'],
datasets: [{
data: [30, 70],
backgroundColor: ['#2196f3', '#4caf50']
}]
},
options: {
responsive: false,
legend: {
display: true,
position: 'right',
onClick: null
},
}
});