Toggle navigation
3D柱状图百分比
By
S***l
2020-12-02 10:06:20
脚本
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
图表已生成
整理代码
刷新
代码
var data = 60; //百分比 var b = 80; var c = 85; option = { backgroundColor: '#000E1A', tooltip: { trigger: 'item', backgroundColor: 'rgba(0,0,0,0.5)', borderColor: 'rgba(89,211,255,1)', borderWidth: 2, padding: 5, textStyle: { color: "rgba(89,211,255,1)", fontSize: 18, width: 300, height: 40, }, formatter: '{c}' + '%', extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);' // 自定义的 CSS 样式 }, grid: { bottom: "10%", top: "35%", }, xAxis: { data: ["英语成绩优秀率", "数学成绩优秀率", "语文成绩优秀率"], axisTick: { show: false }, axisLine: { show: false }, axisLabel: { show: true, textStyle: { color: '#fff' }, margin: 30, //刻度标签与轴线之间的距离。 } }, yAxis: { splitLine: { show: false }, axisTick: { show: false }, axisLine: { show: false }, axisLabel: { show: false } }, series: [ // 头 { name: "", type: "pictorialBar", symbolSize: [150, 45], symbolOffset: [0, -20], z: 12, itemStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: "rgba(54,127,223,1)" }, { offset: 1, color: "rgba(94,162,254,1)" } ], false ), } }, data: [{ name: "", value: 100, symbolPosition: "end", }, { name: "", value: 100, symbolPosition: "end", }, { name: "", value: 100, symbolPosition: "end", }] }, //底部立体柱 { name: "vvvv", stack: '1', type: 'bar', // label: { // show: true, // position: 'top', //top / left / right / bottom / inside / insideLeft / insideRight / insideTop / insideBottom / insideTopLeft / insideBottomLeft / insideTopRight / insideBottomRight // distance: 15, // color: "#FFFE00", // fontSize: 30, // formatter: '{c}' + '%' // }, silent: true, barWidth: 150, barGap: '-100%', // Make series be overlap data: [{ value: data }, { value: b }, { value: c }], itemStyle: { normal: { color: { x: 0, y: 0, x2: 0, y2: 1, type: "linear", global: false, colorStops: [{ //第一节下面 offset: 0, color: "rgba(0,255,245,0.5)" }, { offset: 1, color: "#43bafe" }] } } } }, //三个最低下的圆片 { name: "", type: "pictorialBar", symbolSize: [150, 30], symbolOffset: [0, 16], z: 12, itemStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: "rgba(89,211,255,1)" }, { offset: 1, color: "rgba(23,237,194,1)" } ]) } }, data: [{ name: "", value: "100", }, { name: "", value: "100", }, { name: "", value: "100", }] }, // 中间圆片 { name: "", type: "pictorialBar", symbolSize: [150, 42], symbolOffset: [0, -20], itemStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: "rgba(89,211,255,1)" }, { offset: 1, color: "rgba(23,237,194,1)" } ], false ), } }, z: 12, data: [{ name: "", value: data, symbolPosition: "end", }, { name: "", value: b, symbolPosition: "end", }, { name: "", value: c, symbolPosition: "end", }] }, //上部立体柱 { //上部立体柱 stack: '1', type: 'bar', itemStyle: { normal: { color: '#3E8BE6', opacity: .7 } }, label: { show: true, position: 'top', //top / left / right / bottom / inside / insideLeft / insideRight / insideTop / insideBottom / insideTopLeft / insideBottomLeft / insideTopRight / insideBottomRight distance: 20, color: "#FFFE00", fontSize: 30, formatter: function(item){ var a=100 return a-item.value+'%' } }, silent: true, barWidth: 150, barGap: '-100%', // Make series be overlap data: [{ name: "a", value: 100 - data }, { name: "b", value: 100 - b }, { name: "c", value: 100 - c }] } ] };