Toggle navigation
流量监测
By
hao123hahaha
2018-12-20 08:46:56
脚本
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 zeroTime = new Date(new Date(new Date().toLocaleDateString()).getTime()); var overTime = new Date(zeroTime.getTime() + 24 * 60 * 60 * 1000 - 100); var conf_option = { y_font_color: '#60F194', x_font_color: '#fff', y_line_color: '#184483', x_line_color: '#184483', split_line_color: 'rgba(0,53,115,0.6)' } option = { color: ["#28CDFD", "#FFE996", "#5EF294", "#99AFFF", "#FF7BCC", "#FFB598"], tooltip: { trigger: 'axis' }, legend: { textStyle: { color: '#fff', fontSize: '14px' }, x: 'center', data: ['进水1#流量', '进水2#流量', '进水3#流量', '进水4#流量', '高效沉淀池流量', '出水流量'], itemHeight: 10, itemGap: 40 }, grid: { top: '20%', left: '5%', right: '5%', bottom: '15%' }, xAxis: [{ type: 'time', splitNumber: 24, axisLabel: { formatter: function(v) { let date = new Date(v); let hour = date.getHours(); let minutes = date.getMinutes(); let second = date.getSeconds(); return (hour > 9 ? hour === 23 && minutes === 59 && second > 58 ? '24' : hour : '0' + hour) + ':' + (minutes > 9 ? minutes > 58 && second > 58 ? '00' : minutes : '0' + minutes); }, textStyle: { color: conf_option.x_font_color, fontSize: '12px' } }, axisLine: { lineStyle: { color: conf_option.x_line_color } }, splitLine: { lineStyle: { color: conf_option.split_line_color, width: 0, type: 'solid' } } }], yAxis: [{ type: 'value', axisLabel: { textStyle: { color: conf_option.y_font_color, fontSize: '70%' } }, axisLine: { lineStyle: { color: conf_option.y_line_color, } }, splitLine: { lineStyle: { color: conf_option.split_line_color, width: 1, type: 'solid' } } }], dataZoom: [ //给x轴设置滚动条,可以将拖动条隐藏 { type: 'inside', show: true, //指定是那个轴 xAxisIndex: [0], start: 0, //默认为1 end: 100, //默认为100 }, ], series: [{ name: '进水1#流量', type: 'line', smooth: true, itemStyle: { normal: { areaStyle: { type: 'default', opacity: 0.2 } } }, data: [ [new Date(zeroTime.getTime() + 8 * 60 * 60 * 1000 - 100).getTime(), 23], [new Date(zeroTime.getTime() + 10 * 60 * 60 * 1000 - 100).getTime(), 27], [new Date(zeroTime.getTime() + 13 * 60 * 60 * 1000 - 100).getTime(), 32], [new Date(zeroTime.getTime() + 16 * 60 * 60 * 1000 - 100).getTime(), 23] ] }, { name: '进水2#流量', type: 'line', smooth: true, itemStyle: { normal: { areaStyle: { type: 'default', opacity: 0.2 } } }, data: [] }, { name: '进水3#流量', type: 'line', smooth: true, itemStyle: { normal: { areaStyle: { type: 'default', opacity: 0.2 } } }, data: [] }, { name: '进水4#流量', type: 'line', smooth: true, itemStyle: { normal: { areaStyle: { type: 'default', opacity: 0.2 } } }, data: [] }, { name: '高效沉淀池流量', type: 'line', smooth: true, itemStyle: { normal: { areaStyle: { type: 'default', opacity: 0.2 } } }, data: [] }, { name: '出水流量', type: 'line', smooth: true, itemStyle: { normal: { areaStyle: { type: 'default', opacity: 0.2 } } }, data: [] }, { // 这个是一个将时间范围扩大的一个隐藏线 name: '.anchor', type: 'line', showSymbol: false, data: [{ name: 'start', value: [zeroTime.getTime(), 0] }, { name: 'over', value: [overTime.getTime(), 0] } ], itemStyle: { normal: { opacity: 0 } }, //不绘制该线条 lineStyle: { normal: { opacity: 0 } } } ] };