[Chartjs]-How to get rid of large left and right margins in chart.js donut chart?

5๐Ÿ‘

โœ…

I misread your question, I thought you need google charts. Anyway, there is potential solution for chart js. You will need to add width and height attributes. For example:

<canvas id="myDoughnutChart" width="250%" height="310%"></canvas>

Here is a link to JsFiddle with your code + updated width and height attributes for the first chart (second one is the same for comparison):
https://jsfiddle.net/cncdf4od/2/

5๐Ÿ‘

there is actually a simple solution i found in one of the issues
aspectRatio: 1 in the chart options

https://github.com/chartjs/Chart.js/issues/449

Leave a comment