0
So I’m using the chartjs on a system here, but the pie and donut style does not display on the system. I imported the cdns:
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.0/Chart.bundle.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.0/Chart.js"></script>
And I made a file Graph.js to put the chatjs code and import it in my head:
<code>var ctx = document.getElementById("ChartDonut");
var myDoughnutChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ["Pagos","Pendentes"],
datasets: [{
data: [200, 137],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)'
]
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero:true
}
}]
}
}
});</code>
In my html I call CANVAS normally:
<canvas id="chartDonut"></canvas>
But neither DOUGHNUT nor PIE work. Someone knows the pq?
Dude, read the Chart.JS.documentation well. do you have Nugget installed? ta referenced in your project? in general all charts work equally, needs an options and a date..
– M. Bertolazo