Toggle navigation
双层圆环图
By
经***4
2017-08-15 02:07:26
脚本
16
21
作品使用的第三方脚本
/dep/echarts/map/js/china.js
数据管理
上传数据
支持小于 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
图表已生成
整理代码
刷新
代码
/** * 双层圆环图 * param1 echarts的初始化id echarts.init(document.getElementById('xxx')) * param2 value值 数值型 * param3 value值的单位 * param4 字体及圆环大颜色 * param5,6 最小最大值 */ // function Double_ring(id,value,unit,initcolor,min,max){ var value = 14.7; var unit = "%"; var initcolor = "red"; var min = 0; var max = 100; var color = initcolor; // var size = $("#" + id).css('fontSize'); var size = '100%'; var background = "#00000000"; //背景 // var Myecharts = "mycharts_"+id; // Myecharts = echarts.init(document.getElementById(id)); var dataStyle = { normal: { label: { show: false }, labelLine: { show: false }, shadowBlur: 40, shadowColor: 'rgba(40, 40, 40, 0.5)' } }; var placeHolderStyle = { normal: { color: 'rgba(44,59,70,0)', //未完成的圆环的颜色 label: { show: false }, labelLine: { show: false } } }; // if ((value - min) / (max - min) * 100 >= 70) { // color = 'red'; // } else { // color = initcolor; // } option = { title: { text: value + unit, x: 'center', y: 'center', textStyle: { fontWeight: 'normal', color: color, fontSize: parseInt(size)*0.6 } }, backgroundColor: background, color: [color, '#313443', '#fff'], tooltip: { show: false, formatter: "{a}
{b} : {c} ({d}%)" }, legend: { show: false, itemGap: 12, data: ['01', '02'] }, toolbox: { show: false, feature: { mark: { show: true }, dataView: { show: true, readOnly: false }, restore: { show: true }, saveAsImage: { show: true } } }, series: [{ name: 'Line 1', type: 'pie', clockWise: false, radius: ['50%', '58%'], itemStyle: dataStyle, hoverAnimation: false, data: [{ value: value - min, name: '01', itemStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 1, 1, [{ offset: 0, color: '#7777eb' }, { offset: 1, color: '#70ffac' }]), }, }, }, { value: max - value, name: 'invisible', itemStyle: placeHolderStyle } ] }, { name: 'Line 2', type: 'pie', animation: false, clockWise: false, radius: ['58%', '60%'], itemStyle: dataStyle, hoverAnimation: false, tooltip: { show: false }, data: [{ value: 100, name: '02', itemStyle: { normal: { color: "#3c6482", }, } }] }, { name: 'Line 3', type: 'pie', animation: false, clockWise: false, radius: ['48%', '50%'], itemStyle: dataStyle, hoverAnimation: false, tooltip: { show: false }, data: [{ value: 100, name: '02', itemStyle: { normal: { color: "#3c6482", }, } } ] }] }; // Myecharts.setOption(option) // this.update_Double_ring = function(message){ // if((message-min)/(max-min)*100>=70){ // color='red'; // }else{ // color=initcolor; // } // Myecharts.setOption({ // title: { // text: message+unit, // textStyle: { // color: color // } // }, // color: [color, '#313443', '#fff'], // series:[{ // name: 'Line 1', // data:[{ // name : '01', // value : message-min // },{ // name : 'invisible', // value : max-message // }] // },{ // name : 'Line 2', // data:[{ // name : '01', // value : 0 // },{ // name : 'invisible', // value : 100 // }] // }] // }); // } // }