Toggle navigation
环形饼状图
By
小***0
2020-07-02 10:47:39
脚本
16
21
作品使用的第三方脚本
数据管理
上传数据
支持小于 5M 任意格式(csv, xlsx, json, xml, ...)的数据文件
上传后可以通过生成的文件链接异步获取托管的数据。
历史数据
0 条
无历史数据
代码修改记录
信息提示
保存作品
对当前截图不满意?你还可以
上传本地截图
重新截图
作品名称
作品描述
标签
geo
grid
legend
markLine
markPoint
bar
effectScatter
line
lines
map
timeline
title
toolbox
tooltip
visualMap
作品默认版本
最新
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
20:11:45
图表已生成
整理代码
刷新
代码
option = { title: { show: false }, tooltip: { trigger: "item", formatter: "{a}
{b}: {c} ({d}%)" }, legend: { // 图例部分 icon: "circle", orient: "vertical", left: 137, top: 61, itemGap: 11, itemHeight: 50, itemWidth: 70, align: "center", itemWidth: 0, formatter: function(name, ticket, callback) { // 图例值格式化 var arr2 = ["{b|" + 80] + "%" + "}"; if (name == "营销服务") { return arr2; } }, textStyle: { rich: { a: { verticalAlign: "left", fontSize: 12, align: "left", color: "#000", width: 20 }, b: { fontSize: 47, fontFamily: "DS-Digital-Bold", align: "center", color: "#000", width: 67, // 图例数值宽度 lineHeight: 10, height: 40 } } }, data: ["营销服务", "客服服务"] }, graphic: [ { //环形图中间添加文字 type: "text", //通过不同top值可以设置上下显示 left: "45%", // 文字位置调整 top: "45%", // 文字位置调整 style: { text: "占比" + "\n" + 80 + "%", // 文字内容 textAlign: "center", fill: "#000", //文字的颜色 width: 50, height: 50, fontSize: 50, fontFamily: "Microsoft YaHei" } } ], color: ["#48CFAE", "#5D9CEC"], series: [ { name: "投诉数", type: "pie", radius: ["72%", "78%"], center: ["50%", "50%"], legendHoverLink: false, hoverAnimation: false, avoidLabelOverlap: false, animationDurationUpdate: 0, label: { normal: { show: false } }, data: [ { value: 80, // 蓝色(渐变色)内容部分 name: "营销服务", itemStyle: { color: { type: "linear", x: 0, y: 1, x2: 1, y2: 1, colorStops: [ { offset: 0, color: "#55fafa" // 0% 处的颜色 }, { offset: 1, color: "#5593fa" // 100% 处的颜色 } ], global: false // 缺省为 false } } }, { value: 20, // 灰色内容部分 name: "客服服务", itemStyle: { color: "#EBEEEF" } } ] } ] }