chartist
chartist copied to clipboard
Stroke width bug when override draw event function in Pie Chart
When setting the donutWidth
parameter to the value 30 the actual stroke-width of the donut is not 30px. Causing the donut expand out of the container div
This happens only when you override the draw event function
https://codepen.io/ravillarreal/pen/dyMWaRd
Try changing the donutWidth option and you'll see the actual stroke-width is incorrect
Of course you could solve this by setting a custom stroke-width inside the draw event like this
chart.on('draw', function(context) {
if (context.type === "slice") {
context.element.attr({
style: "stroke-width: 30px;"
});
}
})