chart-pie-demo.js 597 B

12345678910111213141516
  1. // Set new default font family and font color to mimic Bootstrap's default styling
  2. Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
  3. Chart.defaults.global.defaultFontColor = '#292b2c';
  4. // Pie Chart Example
  5. var ctx = document.getElementById("myPieChart");
  6. var myPieChart = new Chart(ctx, {
  7. type: 'pie',
  8. data: {
  9. labels: ["Blue", "Red", "Yellow", "Green"],
  10. datasets: [{
  11. data: [12.21, 15.58, 11.25, 8.32],
  12. backgroundColor: ['#007bff', '#dc3545', '#ffc107', '#28a745'],
  13. }],
  14. },
  15. });