score:4

Accepted answer

because the item you are drawing is larger than 400 pixels, this is actually a bug in chartjs. the current alpha of chartjs 2.0.0 addresses and fixes this problem. the segmentstrokewidth is not taken into account when drawing the chart on the canvas, that causes the it to be larger than the canvas.

a fix for this version would be to subtract the outerradius of your graph by half the stroke width:

var strokewidth = 5;

var options = {
    animation: true,
    segmentstrokewidth : strokewidth
};

...

mynewchart = new chart(ct).doughnut(data, options);
mynewchart.outerradius -= (strokewidth/2);

fiddle example


Related Query

More Query from same tag