[Chartjs]-Use transparent stroke color with chartjs pie chart

3👍

The border or segment stroke is drawn over the sectors. So if you set the color to transparent, you won’t see any gap between the sectors (I assume that is what you are expecting). It’ll be almost as if you set storkewidth to 0.

It’s pretty obvious if you set the segmentStrokeWidth to a high enough value and set a translucent value i.e. something like

var myPieChart = new Chart(ctx).Pie(data, {
    segmentStrokeWidth: 20,
    segmentStrokeColor: "rgba(255, 255, 255, 0.4)"
});

Contrast this fiddle – http://jsfiddle.net/tabb8gy0/ with this – http://jsfiddle.net/m2k62fgp/

Leave a comment