Toggle navigation
04安全服务-重要预警地段
By
适***止
2020-08-22 07:07:21
脚本
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 addressData = ['广州南站东出发平台路段', '广州环城高速', '广州大道南出天大道西83米', '东风中路越秀北路口(西往东)', '南京路市良路南14米', '大广路前出口k3399 500(南往北)', '昌南东路)', '工业大道', '119省道下行9公里', '106国道出望胜北街西38米'] var lastData = [30, 25, 30, 20, 15, 18, 23, 21, 20, 10] var thisData = [30, 0, 10, 20, 10, 30, 0, 10, 20, 20] option = { backgroundColor: "rgba(7,28,52,1)", tooltip: { trigger: 'axis', axisPointer: { // 坐标轴指示器,坐标轴触发有效 type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' } }, legend: { data: ['上期次数', '违法前10地点', '本期次数'], right: "5%", itemWidth: 60, itemHeight: 30, textStyle: { color: "#9AD1FD" }, itemGap: 50 }, grid: [{ left: '1%', right: '4%', bottom: '5%', width: '0%', containLabel: true, show: false }, { left: '5%', right: '4%', bottom: '3%', width: '27%', containLabel: true, show: false }, { left: '33%', right: '4%', bottom: '3%', width: '33%', containLabel: true, show: false }, { left: '67%', bottom: '3%', width: '27%', containLabel: true, show: false }, { right: '4%', bottom: '5%', width: '0%', containLabel: true, show: false } ], xAxis: [{ gridIndex: 1, show: false, inverse: true, type: 'value' }, { gridIndex: 2, show: false, type: 'value' }, { gridIndex: 3, show: false, type: 'value' }, { gridIndex: 0, show: false, type: 'value', }, { gridIndex: 4, show: false, type: 'value', } ], yAxis: [{ gridIndex: 1, show: false, inverse: true, type: 'category', axisTick: { show: false } }, { gridIndex: 2, show: false, inverse: true, type: 'category', axisTick: { show: false } }, { gridIndex: 3, show: false, inverse: true, type: 'category', axisTick: { show: false } }, { gridIndex: 0, show: true, inverse: true, axisLine: { show: false }, axisTick: { show: false }, type: 'category', // data:[-30,-25, -30, -20, -15, -18, -23,-21,-20,-10] data: lastData.map(value => { return { "value": value, "textStyle": { align: 'center', color: '#fff', fontSize: 20 } } }) }, { gridIndex: 4, show: true, inverse: true, axisLine: { show: false }, axisTick: { show: false }, type: 'category', // data:[-30,-25, -30, -20, -15, -18, -23,-21,-20,-10] data: thisData.map(value => { return { "value": value, "textStyle": { align: 'center', color: '#fff', fontSize: 20 } } }) } ], series: [{ name: '上期次数', type: 'bar', stack: '0', barWidth: '50%', showBackground: true, backgroundStyle: { color: 'rgba(9,147,238,0.1)' }, itemStyle: { normal: { color: { type: 'linear', x: 0, y: 0, x2: 1, y2: 0, colorStops: [{ offset: 0, color: 'rgba(192,0,255, 0.6)' // 0% 处的颜色 }, { offset: 1, color: 'rgba(83,14,224, 0.2)' // 100% 处的颜色 }] }, opacity: 1 } }, data: [30, 25, 30, 20, 15, 18, 23, 21, 20, 10] }, { yAxisIndex: 1, xAxisIndex: 1, name: '违法前10地点', type: 'bar', stack: '1', barWidth: '50%', label: { position: 'insideLeft', show: true, fontSize: 20, formatter: (params) => { return addressData[params.dataIndex] } }, itemStyle: { normal: { color: "rgba(48,112,255,.8)" } }, data: [50, 50, 50, 50, 50, 50, 50, 50, 50, 50] }, { xAxisIndex: 2, yAxisIndex: 2, name: '本期次数', type: 'bar', stack: '2', barWidth: '50%', data: [30, 0, 10, 20, 10, 30, 0, 10, 20, 20], itemStyle: { normal: { color: { type: 'linear', x: 0, y: 0, x2: 1, y2: 0, colorStops: [{ offset: 0, color: 'rgba(83,14,224,0.2)' // 0% 处的颜色 }, { offset: 1, color: 'rgba(0,255,252, 0.6)' // 100% 处的颜色 }] }, opacity: 1 } } } ] };