Chartjs-Why doesn't my donut chart, created with Chart.js, appear?

0👍

This is because, you are trying to get other canvas elements, which are not present in reformaTrabalhista.html.

You should better get canvas­‘s context, for all the canvases, like so :

var canvas = document.getElementById("canvas-id-here");
var ctx = canvas && canvas.getContext("2d");

and define the chart instance, as such :

chart-variable-name = ctx && new Chart(ctx).Doughnut(data, options);

Here is the modified version of mycharts.jshttps://kopy.io/0HiRj

Leave a comment