Toggle navigation
带时间轴的双曲线
By
爱***月
2018-01-18 10:36: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
图表已生成
整理代码
刷新
代码
option = { baseOption: { timeline: { show: false, type: 'slider', axisType: 'category', bottom: '10', currentIndex: 0, //0 时表示当前选中项为 timeline.data[0](即使用 options[0] autoPlay: true, //是否自动播放 loop: true, realtime: true, //拖动圆点的时候,是否实时更新视图。 controlPosition: 'left', label: { normal: { color: '#2998ff', }, }, itemStyle: { normal: { color: '#fff', borderColor: '#2998ff', borderWidth: 2, } }, checkpointStyle: { //『当前项』(checkpoint)的图形样式 color: 'rgb(215, 0, 0)', }, lineStyle: { show: true, //false 不显示轴线 color: '#2998ff', }, controlStyle: { //控制按钮的样式 show: true, showPrevBtn: false, showNextBtn: false, itemGap: 50, itemSize: 36, normal: { color: 'rgb(215, 0, 0)', borderColor: 'rgb(215, 0, 0)', }, emphasis: { color: 'rgb(215, 0, 0)', borderColor: 'rgb(215, 0, 0)', }, }, data: ['区域人数', '流入人数', '流出人数'], }, tooltip: { //提示框组件 trigger: 'axis', formatter: '{b}
{a0}: {c0}
{a1}: {c1}', axisPointer: { type: 'shadow', label: { backgroundColor: '#6a7985' } }, textStyle: { color: '#fff', fontStyle: 'normal', fontFamily: '微软雅黑', fontSize: 12, } }, grid: { left: 10, right: 35, bottom: 70, top: 60, containLabel: true, }, legend: { //图例组件,颜色和名字 right: 0, top: 0, itemGap: 16, itemWidth: 20, itemHeight: 14, data: [{ name: '2017-08-05 至 2017-08-05', icon: 'rect', }, { name: '2017-08-06 至 2017-08-06', icon: 'rect', } ], textStyle: { color: '#a8aab0', fontStyle: 'normal', fontFamily: '微软雅黑', fontSize: 12, } }, dataZoom: [{ show: false, bottom: 10, start: 60, end: 100, }, { type: "inside", show: false, height: 15, start: 1, end: 35 }], xAxis: [{ type: 'category', boundaryGap: false, //坐标轴两边留白 axisLabel: { //坐标轴刻度标签的相关设置。 interval: 0, //设置为 1,表示『隔一个标签显示一个标签』 margin: 15, textStyle: { color: '#078ceb', fontStyle: 'normal', fontFamily: '微软雅黑', fontSize: 12, } }, splitLine: { show: true, lineStyle: { color: '#ccc', }, }, axisTick: { //坐标轴刻度相关设置。 show: false, }, axisLine: { //坐标轴轴线相关设置 lineStyle: { color: '#999', } }, }], yAxis: [{ type: 'value', splitNumber: 6, axisLabel: { textStyle: { color: '#333', fontStyle: 'normal', fontFamily: '微软雅黑', fontSize: 12, } }, axisTick: { show: false }, splitLine: { show: false, lineStyle: { color: '#ccc', }, } }], series: [{ name: '2017-08-05 至 2017-08-05', type: 'line', symbol: 'circle', symbolSize: 0, //空心标记的大小 smooth: true, //是否平滑曲线显示 smoothMonotone: 'x', //指明是在 x 轴或者 y 轴上保持单调性 label: { //图形上的文本标签 normal: { show: false, position: 'top', textStyle: { color: '#018ada', fontStyle: 'normal', fontFamily: '微软雅黑', fontSize: 12, } }, }, lineStyle: { //线条样式 normal: { width: 2, color: '#4ac7f5', opacity: 1, } }, itemStyle: { //折线拐点标志的样式。 normal: { color: '#4ac7f5', borderColor: '#4ac7f5', borderWidth: 2, } } }, { markArea: { silent: true, label: { normal: { position: ['10%', '50%'] } }, data: [ [{ name: '优', yAxis: 100, itemStyle: { normal: { color: 'rgba(0,153,153,0.27)' } }, }, { yAxis: 200 }], [{ name: '良', yAxis: 200, itemStyle: { normal: { color: 'rgba(153,204,51,0.2)' } }, }, { yAxis: 300, }], [{ name: '差', yAxis: 300, itemStyle: { normal: { color: 'rgba(250,250,51,0.2)' } } }, { yAxis: 400, }] ] }, name: '2017-08-06 至 2017-08-06', type: 'line', symbol: 'circle', symbolSize: 6, //空心标记的大小 smooth: true, //是否平滑曲线显示 smoothMonotone: 'x', //指明是在 x 轴或者 y 轴上保持单调性 label: { //图形上的文本标签 normal: { show: true, position: 'top', textStyle: { color: '#f6a436', fontStyle: 'normal', fontFamily: '微软雅黑', fontSize: 12, } }, }, areaStyle: { //区域填充样式。 normal: { opacity: 0, color: '#f6a436' } }, lineStyle: { //线条样式 normal: { width: 2, color: '#f6a436' } }, itemStyle: { //折线拐点标志的样式。 normal: { color: '#f6a436', borderColor: '#f6a436', borderWidth: 2, } } }] }, options: [ { title: { text: '222', }, xAxis: [{ data: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00'], }], series: [{ data: [156, 235, 349, 546, 452, 370, 542, 638, 774, 702, 609, 456] }, { data: [352, 286, 315, 429, 566, 486, 399, 562, 658, 794, 702, 629] } ] }, { title: { text: '333', }, xAxis: [{ data: ['01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00'], }], series: [{ data: [546, 452, 370, 542, 638, 774, 702, 609, 456, 420, 398, 326] }, { data: [429, 566, 486, 399, 562, 658, 794, 702, 629, 610, 568, 425] } ] }, { xAxis: [{ data: ['03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00'], }], series: [{ data: [156, 235, 349, 546, 452, 370, 542, 638, 774, 702, 609, 456] }, { data: [352, 286, 315, 429, 566, 486, 399, 562, 658, 794, 702, 629] } ] } ] };