1👍
You can define the desired dimension of your canvas
through the width
or height
property.
<canvas id="chartContainer" width="400"></canvas>
…or using CSS
.
canvas {
width: 400px;
}
Further you should also define responsive: false
and aspectRatio: 1
within the chart options
, latter represents a square canvas.
options: {
responsive: false,
aspectRatio: 1,
See Configuration Options at the Chart.js documentation
- [Chartjs]-How do I customize y-axis labels on a Chart.js line chart?
- [Chartjs]-How to create custom legend in ChartJS
Source:stackexchange.com