Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

How to vary the thickness of doughnut chart, using ChartJs

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
598 views
Welcome To Ask or Share your Answers For Others

1 Answer

since version 2 the field has been renamed to cutoutPercentage.

cutoutPercentage
Number 50 - for doughnut, 0 - for pie
The percentage of the chart that is cut out of the middle.

It can be used like this

var options = {        
    cutoutPercentage: 40
};

more details here http://www.chartjs.org/docs/#doughnut-pie-chart-chart-options

Update: Since version 3

var options = {        
    cutout: 40
};

According to the documentation at release notes of 3.x

Doughnut cutoutPercentage was renamed to cutout and accepts pixels as numer and percent as string ending with %.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...