Chartjs-Change the font size of chart.js with chartkick

3👍

There you are

  <%= pie_chart counters, library: { legend: { position: "left", labels: { fontSize: 26 } } } %>

0👍

I think you’re passing the attribute with wrong case. Should probably be snakeCase and also try using a pixel size like so:

<%= pie_chart Infosheet.group(:gender).count, library: {fontSize: "50px"} %>


<script type="text/javascript">
   new Chartkick.PieChart("chart-1", {"man":4}, {"library":{"fontSize":"50px"}});
</script>

0👍

Use this code

<%= pie_chart Infosheet.group(:gender).count, library: {fontSize: 90} %>

Leave a comment