首页 前端知识 echarts pie饼图/圆环渐变,宽度不一

echarts pie饼图/圆环渐变,宽度不一

2024-09-12 23:09:51 前端知识 前端哥 569 759 我要收藏

效果:

在series里设置:

roseType: 'radius',
复制

即可实现一粗一细效果。

series-pie. roseType
是否展示成南丁格尔图,通过半径区分数据大小。可选择两种模式:
'radius' 扇区圆心角展现数据的百分比,半径展现数据的大小。
'area' 所有扇区圆心角相同,仅通过半径展现数据大小。

图中细的部分为线性渐变,粗的部分为环形渐变

环形渐变和线性渐变:

color: [
// 环形渐变
{
global: true,
type: 'radial',
x: this.fontSize(0.61),
y: this.fontSize(0.61),
r: this.fontSize(0.61),
colorStops: [
{
offset: 0,
color: "#FFE29E", // 0% 处的颜色
},
{
offset: 1,
color: "#DD9C00", // 100% 处的颜色
},
],
},
// 线性渐变
{
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(221, 156, 0, 0.2)", // 0% 处的颜色
},
{
offset: 0.3,
color: "rgba(255, 226, 158, 0.2)", // 0% 处的颜色
},
{
offset: 0.7,
color: "rgba(255, 226, 158, 0.2)", // 0% 处的颜色
},
{
offset: 1,
color: "rgba(221, 156, 0, 0.2)", // 0% 处的颜色
},
],
}
],
复制

转载请注明出处或者链接地址:https://www.qianduange.cn//article/18184.html
标签
评论
还可以输入200
共0条数据,当前/页
发布的文章

安装Nodejs后,npm无法使用

2024-11-30 11:11:38

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!