gpt4 book ai didi

javascript - 如何使用 ChartJs 改变圆环图的厚度?

转载 作者:行者123 更新时间:2023-12-03 00:32:19 31 4
gpt4 key购买 nike

如何使用 ChartJs 改变圆环图的厚度

最佳答案

自版本 2 以来,该字段已重命名为 cutoutPercentage。

剪切百分比
数字 50 - donut ,0 - 馅饼
图表从中间被剪掉的百分比。

可以这样使用

var options = {        
cutoutPercentage: 40
};

更多详情请点击这里 http://www.chartjs.org/docs/#doughnut-pie-chart-chart-options

更新:自版本 3 起

var options = {        
cutout: 40
};

根据 3.x 发行说明中的​​文档

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

关于javascript - 如何使用 ChartJs 改变圆环图的厚度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21014123/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com