Toggle navigation
联动折线图
By
丨陌上花開
2018-03-13 07:04:46
脚本
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 = { tooltip: { trigger: 'axis', axisPointer: { animation: false }, backgroundColor: 'rgba(50,50,50,0.2)', formatter: function(a) { return ( a[0]['axisValueLabel'] + "
" + '
' + a[0]['seriesName'] + ': ' + a[0]['value'] + "
" + '
' + a[1]['seriesName'] + ': ' + a[1]['value'] + "
" + '
' + a[2]['seriesName'] + ': ' + a[2]['value'] ); } }, axisPointer: { link: [{ xAxisIndex: 'all', }], lineStyle: { color: '#fff', width: 0 } }, grid: [{ // 直角坐标系内绘图网格 // show: false, top: '30px', left: '50', right: '55%', width: 'auto', height: 'auto' }, { top: '30px', left: '55%', width: 'auto', height: 'auto' } ], xAxis: [ { // 直角坐标系grid的x轴 gridIndex: 0, type: 'category', boundaryGap: false, axisLabel: { interval: 0, // 显示x轴数据 showMinLabel: true, showMaxLabel: true, align: 'left', rotate: 330 }, axisLine: { lineStyle: { color: '#999' } }, // min: 0, axisTick: { show: false }, data: ['00:00', '02:00', '04:00', '06:00', '08:00', '10:00', '12:00', '14:00', '16:00', '18:00', '20:00', '22:00'] }, { // 直角坐标系grid的x轴 type: 'category', gridIndex: 1, boundaryGap: false, axisLabel: { interval: 0, // 显示x轴数据 showMinLabel: true, showMaxLabel: true, align: 'left', rotate: 330 }, axisLine: { lineStyle: { color: '#999' } }, axisTick: { show: false }, data: ['00:00', '02:00', '04:00', '06:00', '08:00', '10:00', '12:00', '14:00', '16:00', '18:00', '20:00', '22:00'] }, ], yAxis: [{ // 直角坐标系grid的y轴 name: '血压', gridIndex: 0, nameLocation: 'end', type: 'value', axisLine: { onZero: false, lineStyle: { color: '#999' } }, axisTick: { show: false }, // axisLabel: { // // formatter: '{value}%' // }, splitLine: { // y轴网格显示 show: true }, nameTextStyle: { // 坐标轴名样式 color: '#666', fontSize: 12, align: 'left' }, boundaryGap: true, splitNumber: 3, // 坐标轴分割段数 minInterval: 40, // 自动计算的坐标轴最小间隔大小。例如可以设置成1保证坐标轴分割刻度显示成整数。 // interval: 50, // 强制设置坐标轴分割间隔。 data: ['0', '120', '140', '180'] }, { // 直角坐标系grid的y轴 name: '行为分数', gridIndex: 1, nameLocation: 'end', type: 'value', axisLine: { onZero: false, lineStyle: { color: '#999' } }, axisTick: { show: false }, splitLine: { // y轴网格显示 show: true }, nameTextStyle: { // 坐标轴名样式 color: '#666', fontSize: 12, align: 'left' }, boundaryGap: true, splitNumber: 3, // 坐标轴分割段数 minInterval: 40, // 自动计算的坐标轴最小间隔大小。例如可以设置成1保证坐标轴分割刻度显示成整数。 // interval: 50, // 强制设置坐标轴分割间隔。 data: ['0', '120', '140', '180'] }, ], series: [ { xAxisIndex: 0, yAxisIndex: 0, name: '舒张压', type: 'line', smooth: true, smoothMonotone: 'x', lineStyle: { normal: { width: 2, color: '#8ecefc' } }, itemStyle: { normal: { color: '#8ecefc' } }, areaStyle: { normal: { color: '#e6f5fe', origin: 'auto', shadowColor: '#e6f5fe' } }, data: [44, 65, 74, 86, 70, 85, 92, 56, 75, 84, 66, 50] }, { xAxisIndex: 0, yAxisIndex: 0, name: '收缩压', type: 'line', smooth: true, smoothMonotone: 'x', lineStyle: { normal: { width: 2, color: '#7cedc4' } }, itemStyle: { normal: { color: '#7cedc4' } }, areaStyle: { normal: { color: '#7cedc41f', origin: 'auto' } }, data: [34, 55, 54, 76, 60, 75, 72, 16, 55, 74, 36, 10] }, { xAxisIndex: 1, yAxisIndex: 1, name: '行为分数', type: 'line', smooth: true, smoothMonotone: 'x', lineStyle: { normal: { width: 2, color: '#8ecefc' } }, itemStyle: { normal: { color: '#8ecefc' } }, areaStyle: { normal: { color: '#e6f5fe', origin: 'auto', shadowColor: '#e6f5fe' } }, data: [44, 65, 74, 86, 70, 85, 92, 56, 75, 84, 66, 50] } ], textStyle: { color: '#666', fontSize: 12 } }