Toggle navigation
多图表/多Y轴
By
L***c
2019-11-20 06:59: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
图表已生成
整理代码
刷新
代码
var colors = ["#FA607F", "#FF6531", "#2AC290", "#FBB900", "#359EFF", "#7D65FF"]; option = { backgroundColor: "#ffffff", color: colors, tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, legend: { data: ['光照强度', '空气温度', '空气湿度', '土壤温度', '土壤湿度', '土壤EC'] }, dataZoom: { top: '50%', height: '30', type: 'inside', show: true, xAxisIndex: [0, 1], startValue: 20, endValue: 40 }, animation: false, grid: [{ left: 50, right: 50, height: '40%', width: '80%' }, { left: 50, right: 50, top: '55%', height: '40%', width: '80%' }], xAxis: [{ type: 'category', data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], axisTick: { show: false, }, gridIndex: 0 }, { gridIndex: 1, axisLabel: { show: false }, type: 'category', data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], position: 'top' }], yAxis: [{ splitLine: { show: false }, type: 'value', name: '空气温度', min: 0, max: 65, axisLabel: { formatter: '{value} °C' }, axisTick: { show: false }, axisLine: { show: false }, gridIndex: 0 }, { splitLine: { show: false }, type: 'value', name: '土壤温度', min: 0, max: 65, inverse: true, axisLabel: { formatter: '{value} °C' }, axisTick: { show: false }, axisLine: { show: false }, gridIndex: 1, }, { type: 'value', name: '空气湿度', position: 'right', min: 0, max: 100, splitLine: { show: false }, axisTick: { show: false }, axisLine: { show: false }, axisLabel: { formatter: '{value} RH' }, gridIndex: 0 }, { type: 'value', name: '土壤水分', position: 'right', inverse: true, min: 0, max: 60, axisLabel: { formatter: '{value} %' }, splitLine: { show: false }, axisTick: { show: false }, axisLine: { show: false }, gridIndex: 1 }, { type: 'value', name: '光照强度', position: 'right', offset: 60, min: 0, max: 120000, axisLabel: { formatter: '{value} Lux' }, splitLine: { show: false }, axisTick: { show: false }, axisLine: { show: false }, gridIndex: 0 }, { type: 'value', name: '土壤EC', position: 'right', offset: 60, inverse: true, min: 0, max: 6000, axisLabel: { formatter: '{value} μS/cm' }, splitLine: { show: false }, axisTick: { show: false }, axisLine: { show: false }, gridIndex: 1 }, ], series: [{ name: '空气温度', type: 'bar', barWidth: '10px', data: [-12 + 20, -8 + 20, 0 + 20, 12 + 20, 20 + 20, 25 + 20, 28 + 20, 32 + 20, 28 + 20, 25 + 20, 20 + 20, -1 + 20, -12 + 20, -8 + 20, 0 + 20, 12 + 20, 20 + 20, 25 + 20, 28 + 20, 32 + 20, 28 + 20, 25 + 20, 20 + 20, -1 + 20, -12 + 20, -8 + 20, 0 + 20, 12 + 20, 20 + 20, 25 + 20, 28 + 20, 32 + 20, 28 + 20, 25 + 20, 20 + 20, -1 + 20, -12 + 20, -8 + 20, 0 + 20, 12 + 20, 20 + 20, 25 + 20, 28 + 20, 32 + 20, 28 + 20, 25 + 20, 20 + 20, -1 + 20, -12 + 20, -8 + 20, 0 + 20, 12 + 20, 20 + 20, 25 + 20, 28 + 20, 32 + 20, 28 + 20, 25 + 20, 20 + 20, -1 + 20] }, { name: '土壤温度', type: 'bar', barWidth: '10px', xAxisIndex: 1, yAxisIndex: 1, data: [-12 + 20, -8 + 20, 0 + 20, 12 + 20, 20 + 20, 25 + 20, 28 + 20, 32 + 20, 28 + 20, 25 + 20, 20 + 20, -1 + 20, -12 + 20, -8 + 20, 0 + 20, 12 + 20, 20 + 20, 25 + 20, 28 + 20, 32 + 20, 28 + 20, 25 + 20, 20 + 20, -1 + 20, -12 + 20, -8 + 20, 0 + 20, 12 + 20, 20 + 20, 25 + 20, 28 + 20, 32 + 20, 28 + 20, 25 + 20, 20 + 20, -1 + 20, -12 + 20, -8 + 20, 0 + 20, 12 + 20, 20 + 20, 25 + 20, 28 + 20, 32 + 20, 28 + 20, 25 + 20, 20 + 20, -1 + 20, -12 + 20, -8 + 20, 0 + 20, 12 + 20, 20 + 20, 25 + 20, 28 + 20, 32 + 20, 28 + 20, 25 + 20, 20 + 20, -1 + 20] }, { name: '空气湿度', type: 'line', smooth: true, xAxisIndex: 0, yAxisIndex: 2, data: [10, 20, 30, 40, 50, 60, 66, 70, 28, 25, 99, 1, 10, 20, 30, 40, 50, 60, 66, 70, 28, 25, 99, 1, 10, 20, 30, 40, 50, 60, 66, 70, 28, 25, 99, 1, 10, 20, 30, 40, 50, 60, 66, 70, 28, 25, 99, 1, 10, 20, 30, 40, 50, 60, 66, 70, 28, 25, 99, 1] }, { name: '土壤水分', type: 'line', smooth: true, xAxisIndex: 1, yAxisIndex: 3, data: [50, 8, 20, 12, 20, 25, 28, 32, 28, 25, 20, 40, 50, 8, 20, 12, 20, 25, 28, 32, 28, 25, 20, 40, 50, 8, 20, 12, 20, 25, 28, 32, 28, 25, 20, 40, 50, 8, 20, 12, 20, 25, 28, 32, 28, 25, 20, 40, 50, 8, 20, 12, 20, 25, 28, 32, 28, 25, 20, 40] }, { name: '光照强度', type: 'line', smooth: true, xAxisIndex: 0, yAxisIndex: 4, data: [5000, 80000, 20000, 12000, 30000, 55000, 80000, 32000, 28000, 25000, 20000, 40000, 5000, 80000, 20000, 12000, 30000, 55000, 80000, 32000, 28000, 25000, 20000, 40000, 5000, 80000, 20000, 12000, 30000, 55000, 80000, 32000, 28000, 25000, 20000, 40000, 5000, 80000, 20000, 12000, 30000, 55000, 80000, 32000, 28000, 25000, 20000, 40000, 5000, 80000, 20000, 12000, 30000, 55000, 80000, 32000, 28000, 25000, 20000, 40000] }, { name: '土壤EC', type: 'line', smooth: true, xAxisIndex: 1, yAxisIndex: 5, data: [500, 120, 5000, 120, 3000, 5500, 800, 320, 280, 250, 200, 400, 500, 120, 5000, 120, 3000, 5500, 800, 320, 280, 250, 200, 400, 500, 120, 5000, 120, 3000, 5500, 800, 320, 280, 250, 200, 400, 500, 120, 5000, 120, 3000, 5500, 800, 320, 280, 250, 200, 400, 500, 120, 5000, 120, 3000, 5500, 800, 320, 280, 250, 200, 400] } ] };