Toggle navigation
供气用量对比分析
By
欧***一
2019-12-31 06:43:36
脚本
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
图表已生成
整理代码
刷新
代码
// Generate data var category = ['2019-12-01','2019-12-02','2019-12-03','2019-12-04','2019-12-05', ]; var dottedBase = []; var lineData = [2869,2657,3288 ,3698,3878 ]; var barData = [460,550,750 ,850,800 ]; var rateData = []; 32808 for (var i = 0; i < 33; i++) { // var date = i+2001; // category.push(date) var rate=barData[i]/lineData[i]*1000; //计算计划量比率 rateData[i] = rate.toFixed(2); } // option option = { title: { // text: '供气用量对比分析', x: 'center', top: "3%", textStyle:{ color:'#fff', fontSize:18, fontWeight:'normal', }, }, backgroundColor: '#18315A', tooltip: { //鼠标滑过数据的展示形式 trigger: 'axis', backgroundColor:'rgba(255,255,255,0.1)', axisPointer: { type: 'shadow', label: { show: true, backgroundColor: '#7B7DDC' } } }, legend: { data: ['实际用量', '计划量',], // 控制标签的位置 textStyle: { color: '#ccc' //标签颜色 }, top:'7%', right:'10%' }, grid:{ left:'center', // 控制图表的大小位置 width:'90%', top:'10%', }, xAxis: { data: category, //x轴展示数据 axisLine: { lineStyle: { color: '#B4B4B4' //x轴坐标颜色 } }, axisTick:{ show:true, //x轴坐标标注 }, axisLabel:{ textStyle:{ color:"#ccc", fontSize:16 } } }, yAxis: [{ name:'单位:万m³', //y轴单位 splitLine: { show: true, lineStyle:{ type:'dashed', opacity:0.6 //设置透明度 }// y轴虚线 }, axisLine: { lineStyle: { color: '#B4B4B4', //y轴显示样式 } }, axisLabel:{ formatter:'{value} ', textStyle:{ color:"#ccc", fontSize:16 } } }, { splitLine: {show: false}, //两个y轴,所以分别设置两个y轴的数据 axisLine: { lineStyle: { color: '#B4B4B4', } }, axisLabel:{ formatter:'{value} %', } }], series: [{ name: '计划量', //曲线展示设置 name要和legend对应 type: 'line', smooth: true, showAllSymbol: true, symbol: 'emptyCircle', //曲线链接点的显示形式 symbolSize: 8, yAxisIndex: 1, itemStyle: { normal: { color:'#F02FC2'},// 设置曲线颜色 }, data: rateData }, { name: '实际用量', //柱状图显示样式 type: 'bar', barWidth: 20, //设置柱状的宽度 itemStyle: { normal: { barBorderRadius: 5, //圆角 color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [ {offset: 0, color: '#956FD4'}, //柱状图渐变颜色 {offset: 1, color: '#3EACE5'} ] ) } }, data: barData } ] };