Toggle navigation
车流量当月统计
By
天使第一二
2019-01-14 07:34:35
脚本
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 = [{ "name": "光谷三路", "value": 8 }, { "name": "黄陵大道", "value": 11 }, { "name": "临空港大道", "value": 13 }, { "name": "青年路", "value": 12 }, { "name": "八一路", "value": 15 }, { "name": "兴业路", "value": 16 }, { "name": "汉阳大街", "value": 10 }, { "name": "汉施大道", "value": 16 }, { "name": "沿河大道", "value": 16 }]; var xData = [], yData = []; data.map(function(a, b) { xData.push(a.name); yData.push(a.value); // yData.push((Math.random(0,1) * 100).toFixed(0)); }); option = { backgroundColor: "#fff", tooltip: { trigger: 'axis', axisPointer: { type: 'line', lineStyle: { opacity: 0 } }, formatter: function(prams) { var htmlStr = '车流量:' + prams[0].data + '万' + '
' + '合格率:' + prams[1].data + '%'; return htmlStr; } }, tooltip: { trigger: 'axis', axisPointer: { //type: 'line', lineStyle: { opacity: 0 } }, formatter: function(prams) { var seriesName = prams[0].name; var htmlStr = seriesName + '
车流量:' + prams[0].data + '万' + '
' + '合格率:' + prams[1].data + '%'; return htmlStr; } }, legend: { show: true, data: ['车流量', '遥测合格率'] }, grid: { left: '5%', right: '5%', bottom: '5%', top: '7%', height: '85%', containLabel: true, z: 1 }, xAxis: [{ type: 'category', data: xData, axisTick: { show: false }, axisLine: { show: false }, axisLabel: { show: true, color: 'rgb(170,170,170)', fontSize: 16 } }], yAxis: [{ name: '车流量(单位:万)', type: 'value', splitLine: { show: false }, axisTick: { show: false }, axisLine: { show: false, lineStyle: { color: '#0c3b71' } }, axisLabel: { color: 'rgb(170,170,170)', //formatter: '{value} %' } }, { name: '遥测合格率(单位:%)', type: 'value', position: 'right', splitLine: { show: false }, axisTick: { show: false }, axisLine: { show: false, lineStyle: { color: '#0c3b71' } }, axisLabel: { color: 'rgb(170,170,170)', formatter: '{value} %' }, //data:['20','40','60','80','100'] max: 100 }], series: [{ name: '车流量', yAxisIndex: 0, type: 'bar', barWidth: '20', itemStyle: { normal: { barBorderRadius: [30, 30, 0, 0], color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [{ offset: 0, color: 'rgb(185,121,245)' }, { offset: 1, color: 'rgb(240,147,186)' } ] ) } }, markPoint: { label: { color: '#FFF' }, data: [{ name: '', type: 'min', }] }, data: yData, //zlevel: 1 }, { name: '遥测合格率', type: 'line', yAxisIndex: 1, itemStyle: { normal: { color: 'rgb(86,152,255)', lineStyle: { width: 2, type: 'solid', } } }, label: { normal: { show: false, //折线上方label控制显示隐藏 position: 'top', } }, symbol: 'circle', symbolSize: 6, areaStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 1, color: 'rgb(255,255,255,0)' }, { offset: 0, color: 'rgb(116,170,255)' }], false), shadowColor: 'rgba(0, 0, 0, 0.1)', shadowBlur: 10 } }, markPoint: { label: { color: '#FFF', formatter: '{c}%' }, data: [{ name: '', type: 'max', }] }, data: yData, //zlevel: 1 } ] };