2017-01-26 2 views
1

Ich möchte Tooltips in Diagrammgröße ändern. Ich habe globale Einstellungen verwendet, funktioniert aber nicht. Tooltips in meinen Charts sind zu klein. Here is the viewChart.js Donut-Diagramm Tooltip Größe?

$(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 
     } 
    }); 
}); 
+0

Sie sehen könnten [Chart JS benutzerdefinierte Tooltip Option] (http://stackoverflow.com/a/39204408/2026740) –

+0

Works, danke! in Optionen verwenden nur Tooltips: { bodyFontSize: 25 } – Zomfire

+0

Sollte sein: Chart.defaults.global.tooltips.titleFontSize = 16; Sie haben die .tooltips vergessen :) –

Antwort

0
options: { 
    tooltips: { bodyFontSize: 20 } 
} 
2

können Sie die Größe zu Titel Schriftart ändern.

options: { 
    tooltips: { 
    titleFontSize: 10, 
    bodyFontSize: 10 
    } 
} 
Verwandte Themen