Accepted answer

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.js -

Related Query

More Query from same tag