// Set new default font family and font color to mimic Bootstrap's default styling
Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
Chart.defaults.global.defaultFontColor = '#292b2c';

// Pie Chart Example

fetch('api/grafico_dre.php')
.then(response => response.json())
.then(data =>{

var ctx = document.getElementById("myPieChart");
 new Chart(ctx, {
  type: 'pie',
  data: {
    labels: 'Total entradas',
    datasets: [{
      data: data.entradas,
      backgroundColor: '#28a745',
    }],
  },

  data: {
    labels: 'Total saidas',
    datasets: [{
      data: data.saidas,
      backgroundColor: '#dc3545',
    }],
  },

  data: {
    labels: 'Saldo Capital',
    datasets: [{
      data: 2029202,
      backgroundColor: '#007bff',
    }],
  },
});
})