Toggle navigation
柱状图与折线图-3个参数的展示
By
c***6
2021-02-05 09:54:31
脚本
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
图表已生成
整理代码
刷新
代码
//此图用来展示有3个维度的图形报表 option = { color: ['#5793f3', '#d14a61', '#675bba'], tooltip: { trigger: 'axis', // axisPointer: { // // type: 'cross' // } }, grid: { left: '8%', //柱状图距离左边的距离,也可以用像素px right: '18%', //柱状图距离右边的距离,也可以用像素px bottom: '10%', //网格图(柱状图、折线图、气泡图等)离底部的距离,也可以用像素比如10px }, // toolbox: { // feature: { // dataView: {show: true, readOnly: false}, // restore: {show: true}, // saveAsImage: {show: true} // } // }, legend: { data: ['蒸发量', '降水量', '平均温度'] }, xAxis: [ { type: 'category', axisTick: { alignWithLabel: true }, data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] } ], yAxis: [ { type: 'value', name: '蒸发量', min: 0, max: 250, position: 'right', axisLine: { lineStyle: { color: '#5793f3' } }, axisLabel: { formatter: '{value} ml' } }, { type: 'value', name: '降水量', min: 0, max: 250, position: 'right', offset: 100, axisLine: { lineStyle: { color: '#d14a61' } }, axisLabel: { formatter: '{value} ml' } }, { type: 'value', name: '温度', // min: 0, // max: 25, position: 'left', axisLine: { lineStyle: { color: '#675bba' } }, axisLabel: { formatter: '{value} °C' } } ], // 缩放组件 dataZoom: { type: 'slider', start:0, end:80 //缩放组件显示70%的位置 }, series: [ { name: '蒸发量', type: 'bar', barWidth: '40%', //barWidth设置每根柱状图的宽度 data: [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3] }, { name: '降水量', type: 'bar', barWidth: '30%', //barWidth设置每根柱状图的宽度 yAxisIndex: 1, data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3] }, { name: '平均温度', type: 'line', yAxisIndex: 2, data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2] } ] };