10

i'm want to resize tooltips on chart. I've used global settings but doesn't work. Tooltips on my charts are too small. Here is the view

$(document).ready(function () {
    // Chart options
    Chart.defaults.global.legend.display = false;
    Chart.defaults.global.titleFontSize = 20;
    var ctx = document.getElementById("Chart1");
    var myChart = new Chart(ctx, {
        type: 'doughnut',
        data: {
            labels: [
                "Produkty",
                ""
            ],
            datasets: [
            {
                data: <?=json_encode(array_values($values));?>,
                backgroundColor: [
                    "#2ecc71",
                    "#3498db"
                ],
                hoverBackgroundColor: [
                    "#27ae60",
                    "#2980b9"
                ]
            }]
        },
        options: {
            cutoutPercentage: 80
        }
    });
});
tektiv
  • 14,010
  • 5
  • 61
  • 70
Zomfire
  • 193
  • 1
  • 3
  • 15

3 Answers3

17

You can change the title font size too.

options: {
  tooltips: {
    titleFontSize: 10,
    bodyFontSize: 10
  }
}
Sergey Sklyar
  • 1,902
  • 1
  • 15
  • 27
tiagorockman
  • 341
  • 2
  • 6
1
options: {
     tooltips: { bodyFontSize: 20 }
}
Paul Roub
  • 36,322
  • 27
  • 84
  • 93
Gobinathan
  • 11
  • 1
0

For me this was required to go in the library section

{
  ...,
  library: {
    tooltips: {
      ...
    },
  },
  ...
}