Toggle navigation
简单时间轴折线图
By
啵***巴
2020-03-23 09:04:58
脚本
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 = { timeline: { data: [ '2018', '2019', '2020' ], axisType: 'category', show: true, autoPlay: false, lineStyle:{ color:'#a3a4a9' }, label:{ color:'#a3a4a9' }, controlStyle:{ color:'red' } // playInterval: 1000 }, options: [{ backgroundColor: 'rgba(0,0,0,0)', legend:{ show:true, data:['行政处罚数','投诉数'], right: 50, textStyle:{ color:'#a3a4a9' } }, tooltip: { show:true, trigger: 'axis', axisPointer: { lineStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: 'rgba(255,255,255,0)' // 0% 处的颜色 }, { offset: 0.5, color: 'rgba(255,255,255,1)' // 100% 处的颜色 }, { offset: 1, color: 'rgba(255,255,255,0)' // 100% 处的颜色 } ], global: false // 缺省为 false } } } }, grid: { top: '18%', left: '15%', right: '15%', bottom: '25%' // containLabel: true }, xAxis: [{ type: 'category', boundaryGap: true, axisLine: { //坐标轴轴线相关设置。数学上的x轴 show: true, lineStyle: { color: 'rgba(255,255,255,0.4)' } }, axisLabel: { //坐标轴刻度标签的相关设置 textStyle: { color: '#a3a4a9', margin: 15 } }, axisTick: { show: false }, name:'单位/月', data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] }], yAxis: [{ type: 'value', splitNumber: 4, splitLine: { show: false, lineStyle: { color: 'rgba(255,255,255,0.1)' } }, axisLine: { show: false }, axisLabel: { show: true, margin: 20, textStyle: { color: '#a3a4a9' } }, axisTick: { show: false } }], series: [{ name: '行政处罚数', type: 'line', // smooth: true, //是否平滑曲线显示 symbol:'circle', // 默认是空心圆(中间是白色的),改成实心圆 showAllSymbol: true, // symbol: 'image://./static/images/guang-circle.png', symbolSize: 4, lineStyle: { normal: { color: 'rgba(0,70,209,0.8)' // 线条颜色 }, borderColor: '#f0f' }, itemStyle: { normal: { color: 'rgba(0,70,209,1)' } }, areaStyle: { //区域填充样式 normal: { //线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。 color: 'rgba(0,70,209,0.5)', shadowColor: 'rgba(53,142,215, 0.9)', //阴影颜色 shadowBlur: 20 //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。 } }, data: [150, 130, 180, 200, 378, 450, 450] }, { name: '投诉数', type: 'line', // smooth: true, //是否平滑曲线显示 symbol:'circle', // 默认是空心圆(中间是白色的),改成实心圆 showAllSymbol: true, // symbol: 'image://./static/images/guang-circle.png', symbolSize: 4, lineStyle: { normal: { color: '#53fdfe' // 线条颜色 }, borderColor: '#53fdfe' }, itemStyle: { normal: { color: '#53fdfe' } }, areaStyle: { //区域填充样式 normal: { //线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。 color: 'rgba(0,253,252,0.5)', shadowColor: 'rgba(53,142,215, 0.9)', //阴影颜色 shadowBlur: 20 //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。 } }, data: [50, 30, 59, 60, 78, 55, 50] } ] }, { series: [{ data: [15, 20, 25, 30, 78, 40, 50] }, { data: [50, 30, 59, 40, 48, 55, 50] } ] }, { series: [{ data: [24, 36, 36, 53, 78, 45, 50] }, { data: [40, 20, 63, 25,54, 70, 10] } ] } ] }