Toggle navigation
By
绿***绿
2020-11-02 02:01: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
图表已生成
整理代码
刷新
代码
option = { backgroundColor: '#010f1c', tooltip: { trigger: 'axis', axisPointer: { type: 'cross', label: { backgroundColor: '#6a7985' }, } }, grid: { left: '15px', top: '30px', right: '20px', bottom: '0', containLabel: true }, xAxis: [{ type: 'category', boundaryGap: false, axisTick: { show: false }, axisLine: { lineStyle: { color: '#11505a', } }, axisLabel: { interval: 0, //设置x轴的标签显示可自适应 show: true, textStyle: { color: '#d1d1d1' } }, data: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'] }], yAxis: [{ type: 'value', name: '单位 / A', nameTextStyle: { //y轴上方单位的颜色 color: '#d1d1d1' }, nameGap: 10, axisTick: { show: false }, axisLine: { show: false, //y轴线 lineStyle: { color: '#14568d', } }, axisLabel: { // margin: 10, textStyle: { fontSize: 12, color: '#d1d1d1', } }, splitLine: { show: true, lineStyle: { color: ['#11505a'], width: 1, type: 'solid' } }, }], series: [{ name: '电力', type: 'line', // smooth: true, symbol: 'circle', symbolSize: 2, showSymbol: false, markLine: { silent: true, symbol: ['none', 'triangle'], symbolSize: 5, lineStyle: { color: '#f12325' }, label: { show: false }, data: [{ yAxis: 50 }, ] }, lineStyle: { shadowColor: '#fff', shadowBlur: 10, shadowOffsetY: 0, width: 2, color: '#5bddcd', }, areaStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, //RGB(91,221,205) color: 'rgba(91,221,205, 0.9)' }, { offset: 0.5, color: 'rgba(91,221,205,0.5)' }, { offset: 0.8, color: 'rgba(91,221,205,0.2)' }, { offset: 1, color: 'transparent' } ], false), // shadowColor: 'rgba(232,246,254,0.2)', shadowBlur: 30 } }, itemStyle: { normal: { color: '#5bddcd', borderColor: '#5bddcd', borderWidth: 0 } }, data: [0, 50, 30, 60, 40, 80, 44], }, { name: '流', type: 'line', // smooth: true, symbol: 'circle', symbolSize: 2, showSymbol: false, lineStyle: { width: 2, color: '#fff', }, animationEasingUpdate:'quadraticIn', //animationDurationUpdate:800, data: [null, null, null, null, null, null, null], }, ] }; let num=0; let intervalId = setInterval(function () { let _data = [null, null, null, null, null, null, null]; if (num < _data.length - 1) { _data[num] = option.series[0].data[num] _data[num+1] = option.series[0].data[num+1] option.series[1].data = _data; myChart.setOption(option) console.log(option.series[1].data) } else { clearInterval(intervalId); } num ++ }, 800); /*setTimeout(function() { var option = myChart.getOption(); for (let i = 0; i < option.series[1].data.length; i++) { let _data = [null, null, null, null, null, null, null] if (i == option.series[1].data.length -1) { } else { _data[i] = option.series[0].data[i] _data[i+1] = option.series[0].data[i+1] } option.series[1].data = _data setTimeout(function(){ console.log(option.series[1].data) myChart.setOption(option) },500) } }, 1000);*/