Toggle navigation
双Y轴为什么其中一个不能随数值的变化而变化
By
手绘梦想
2016-08-26 15:33: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
图表已生成
整理代码
刷新
代码
var option = { tooltip: { trigger: 'axis' }, legend: { // Legend各个item之间的间隔,横向布局时为水平间隔,纵向布局时为纵向间隔 data: ['次数', '小时'], padding: 5, // 图例内边距,单位px,默认上下左右内边距为5 itemGap: 50, // Legend各个item之间的间隔,横向布局时为水平间隔,纵向布局时为纵向间隔 itemWidth: 60, //图例高度宽度 itemHeight: 30, textStyle: { //文字样式 fontSize: '18', fontFamily: '微软雅黑', fontWeight: 'bold' } }, grid: { top: "15%", bottom: '15%', containLabel: true }, toolbox: { show: true, orient: 'horizontal', // 布局方式,默认为水平布局,可选为: // 'horizontal' ¦ 'vertical' x: '75%', // 水平安放位置,默认为全图右对齐,可选为: // 'center' ¦ 'left' ¦ 'right' // ¦ {number}(x坐标,单位px) y: '0%', // 垂直安放位置,默认为全图顶端,可选为: // ¦ {number}(y坐标,单位px) // 'top' ¦ 'bottom' ¦ 'center' // color : ['#1e90ff','#22bb22','#4b0082','#d2691e'], itemSize: 20, feature: { dataView: { //数据图表 show: true, readOnly: true, iconStyle: { //图标颜色 normal: { borderColor: '#8acdef', //图标线框颜色 borderWidth: 2, } }, }, magicType: { show: true, type: ['line', 'bar'], readOnly: true, iconStyle: { //图标颜色 normal: { borderColor: '#8acdef', //图标线框颜色 borderWidth: 2, } }, }, restore: { show: true, title: '还原', iconStyle: { //图标颜色 normal: { borderColor: '#8acdef', //图标线框颜色 borderWidth: 2, } }, }, saveAsImage: { show: true, title: '保存图片', type: 'png', lang: ['点击本地保存'], iconStyle: { //图标颜色 normal: { borderColor: '#8acdef', //图标线框颜色 borderWidth: 2, } }, }, } }, calculable: true, /* dataZoom : { show : true, realtime : true, start : 20, end : 80, textStyle:{ fontStyle:20, }, top:"90%" },*/ xAxis: [ { type: 'category', nameGap: 600, //坐标轴名字里坐标系的距离 nameTextStyle: { ontStyle: 'oblique', fontWeight: 800, fontSize: 40, }, nameRotatea: 120, axisLabel: { roeate: 60, interval: 3, margin: 80, textStyle: { fontWeight: 800, fontSize: 18, } }, data: function() { var list = []; for (var i = 1; i <= 30; i++) { list.push('2016-05-' + i); } return list; }() } ], yAxis: [{ 'type': 'value', 'name': '单位(次)', 'nameGap': 30, //坐标轴名字里坐标系的距离 'nameTextStyle': { ontStyle: 'oblique', fontWeight: 800, fontSize: 18, }, // 'max':100, 'splitNumber': 10, //'boundaryGap':true, // x的距离 'axisLabel': { //字体 margin: 20, textStyle: { fontStyle: 'oblique', fontWeight: 800, fontSize: 18, } } }, { 'type': 'value', 'name': '时长(小时)', 'nameGap': 30, //坐标轴名字里坐标系的距离 'nameTextStyle': { ontStyle: 'oblique', fontWeight: 800, fontSize: 18, }, // 'min':0, // 'max':100, 'splitNumber': 10, 'axisLabel': { //字体 margin: 20, textStyle: { fontStyle: 'oblique', fontWeight: 800, fontSize: 18, }, }, }, ], series: [{ name: '次数', type: 'line', itemStyle: { normal: { // 系列级个性化,横向渐变填充 label: { show: true, textStyle: { fontSize: '20', fontFamily: '微软雅黑', fontWeight: 'bold' } } } }, data: function() { var list = []; for (var i = 1; i <= 30; i++) { list.push(Math.round(Math.random() * 100)); } return list; }() }, { name: '小时', type: 'line', itemStyle: { normal: { // 系列级个性化,横向渐变填充 label: { show: true, textStyle: { fontSize: '20', fontFamily: '微软雅黑', fontWeight: 'bold' } } } }, data: function() { var list = []; for (var i = 0; i <= 30; i++) { list.push(Math.round(Math.random() * 100)); } return list; }(), }] };