[Chartjs]-Make pie chart smaller Chart JS

13πŸ‘

βœ…

To make the pie chart smaller, set responsive property to false in your chart options, like so …

var options = {
  ...
  responsive: false,
  ...
}

1πŸ‘

In var ctxPTD = $("#myChart2").get(0).getContext("2d");, you could use a HTML DOM element, not a jQuery element, and set height only like:

var ctxPTD = document.getElementById("myChart2");
ctxPTD.height = 200;

Hope it works.

Leave a comment