Toggle navigation
y轴用图片
By
二***弃
2019-09-09 17:22:08
脚本
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 img0 = "/asset/get/s/data-1568049553850-VkfO0I7uw.png"; var img1 = "/asset/get/s/data-1568049452851-43gRdndu6.png"; var img2 = "/asset/get/s/data-1568049460502-HMJMmLO84.png"; var sddata=[ {name:'成都',val:1}, {name:'绵阳',val:1}, {name:'攀枝花',val:1}, {name:'泸州',val:2}, {name:'德阳',val:2}, {name:'广元',val:3}, {name:'遂宁',val:3} ] var sddata2=[ {name:'成都',val:3}, {name:'绵阳',val:1}, {name:'攀枝花',val:1}, {name:'泸州',val:2}, {name:'德阳',val:2}, {name:'广元',val:3}, {name:'遂宁',val:3} ] var sddata3=[ {name:'成都',val:2}, {name:'绵阳',val:1}, {name:'攀枝花',val:1}, {name:'泸州',val:2}, {name:'德阳',val:2}, {name:'广元',val:3}, {name:'遂宁',val:3} ] option = { xAxis: [ { type: 'value', show:false,//网格线 min:80 }, { type: 'value', gridIndex: 1, min:80, show:false,//网格线 },{ type: 'value', show:false,//网格线 min:80, gridIndex: 2 }, ], yAxis: [ { axisTick: {show: false},//去掉间隔线 axisLine: {show: false,},//去掉轴线 data: ['成都','绵阳','攀枝花','泸州','德阳','广元','遂宁'], axisLabel: { formatter: function (value,index) { var val=''; if(sddata[index].val==1){ val='{a| }{value|' +' '+ value + '}'; }else if(sddata[index].val==2){ val='{b| }{value|' +' '+ value + '}'; }else if(sddata[index].val==3){ val='{c| }{value|' +' '+ value + '}'; } return val }, margin: 20, rich: { a: { height: 20, align: 'center', backgroundColor: { image: img0 } }, b: { height:20, align: 'center', backgroundColor: { image:img1 } }, c: { height: 20, align: 'center', backgroundColor: { image:img2 } }, } } }, { axisTick: {show: false},//去掉间隔线 axisLine: {show: false,},//去掉轴线 data: ['成都','绵阳','攀枝花','泸州','德阳','广元','遂宁'], axisLabel: { formatter: function (value,index) { var val=''; if(sddata2[index].val==1){ val='{a| }{value|' +' '+ value + '}'; }else if(sddata2[index].val==2){ val='{b| }{value|' +' '+ value + '}'; }else if(sddata2[index].val==3){ val='{c| }{value|' +' '+ value + '}'; } return val }, margin: 20, rich: { a: { height: 20, align: 'center', backgroundColor: { image: img0 } }, b: { height:20, align: 'center', backgroundColor: { image:img1 } }, c: { height: 20, align: 'center', backgroundColor: { image:img2 } }, } }, gridIndex: 1 },{ axisTick: {show: false},//去掉间隔线 axisLine: {show: false,},//去掉轴线 data: ['成都','绵阳','攀枝花','泸州','德阳','广元','遂宁'], axisLabel: { formatter: function (value,index) { var val=''; if(sddata3[index].val==1){ val='{a| }{value|' +' '+ value + '}'; }else if(sddata3[index].val==2){ val='{b| }{value|' +' '+ value + '}'; }else if(sddata3[index].val==3){ val='{c| }{value|' +' '+ value + '}'; } return val }, margin: 20, rich: { a: { height: 20, align: 'center', backgroundColor: { image: img0 } }, b: { height:20, align: 'center', backgroundColor: { image:img1 } }, c: { height: 20, align: 'center', backgroundColor: { image:img2 } }, } }, gridIndex: 2 } ], grid: [ { top:'6%', right:'70%', bottom: '10%', left:'12%' }, { top:'6%', right:'35%', bottom: '10%', left:'37%', }, { top:'6%', right:'2%', bottom: '10%', left:'72%', } ], series: [ { type: 'bar', data: [82,83,85,86,87,88,95], itemStyle: { normal: { color: '#3297DB' } }, barWidth: '17', label: { normal: { show: true, color:'#fff', position: ['5','20%'], formatter:'{c}%' } } }, { name: '', show:false, align: 'left', type: 'bar', yAxisIndex: 0, itemStyle: { normal: { color: '#3297DB' } }, barWidth: '0.01', label: { normal: { position: 'right', } }, data: [92,92,92,92,92,], markLine:{ symbol:'none',//去掉箭头 data:[ {type:'average',name:'平均值'} ], label:{ position:'end', formatter:'{c}%' }, lineStyle:{ color:'red' } }, }, { name: '', show:false, align: 'left', type: 'bar', yAxisIndex: 0, itemStyle: { normal: { color: '#3297DB' } }, barWidth: '0.01', label: { normal: { position: 'right', } }, data: [95,95,95,95,95], markLine:{ padding: [0, -70], symbol:'none',//去掉箭头 data:[ {type:'average',name:'平均值'} ], label:{ position:'start', formatter:'{c}%' }, lineStyle:{ color:'#4FEE27' } }, }, { type: 'bar', data: [82,83,85,86,87,88,95], itemStyle: { normal: { color: '#3297DB' } }, barWidth: '17', label: { normal: { show: true, color:'#fff', position: ['5','20%'], formatter:'{c}%' } }, xAxisIndex: 1, yAxisIndex: 1 }, { name: '', show:false, align: 'left', type: 'bar', yAxisIndex: 0, itemStyle: { normal: { color: '#3297DB' } }, barWidth: '0.01', label: { normal: { position: 'right', } }, data: [92,92,92,92,92,], markLine:{ symbol:'none',//去掉箭头 data:[ {type:'average',name:'平均值'} ], label:{ position:'end', formatter:'{c}%' }, lineStyle:{ color:'red' } }, xAxisIndex: 1, yAxisIndex: 1 }, { name: '', show:false, align: 'left', type: 'bar', yAxisIndex: 0, itemStyle: { normal: { color: '#3297DB' } }, barWidth: '0.01', label: { normal: { position: 'right', } }, data: [95,95,95,95,95], markLine:{ padding: [0, -70], symbol:'none',//去掉箭头 data:[ {type:'average',name:'平均值'} ], label:{ position:'start', formatter:'{c}%' }, lineStyle:{ color:'#4FEE27' } }, xAxisIndex: 1, yAxisIndex: 1 }, { type: 'bar', data: [82,83,85,86,87,88,95], itemStyle: { normal: { color: '#3297DB' } }, barWidth: '17', label: { normal: { show: true, color:'#fff', position: ['5','20%'], formatter:'{c}%' } }, xAxisIndex: 2, yAxisIndex: 2 }, { name: '', show:false, align: 'left', type: 'bar', yAxisIndex: 0, itemStyle: { normal: { color: '#3297DB' } }, barWidth: '0.01', label: { normal: { position: 'right', } }, data: [92,92,92,92,92,], markLine:{ symbol:'none',//去掉箭头 data:[ {type:'average',name:'平均值'} ], label:{ position:'end', formatter:'{c}%' }, lineStyle:{ color:'red' } }, xAxisIndex: 2, yAxisIndex: 2 }, { name: '', show:false, align: 'left', type: 'bar', yAxisIndex: 0, itemStyle: { normal: { color: '#3297DB' } }, barWidth: '0.01', label: { normal: { position: 'right', } }, data: [95,95,95,95,95], markLine:{ padding: [0, -70], symbol:'none',//去掉箭头 data:[ {type:'average',name:'平均值'} ], label:{ position:'start', formatter:'{c}%' }, lineStyle:{ color:'#4FEE27' } }, xAxisIndex: 2, yAxisIndex: 2 }, ] };