option = {
xAxis: [{
type: ‘category’,
data: [‘Mon’, ‘Tue’, ‘Wed’, ‘Thu’, ‘Fri’, ‘Sat’, ‘Sun’]
},{
type: ‘category’,
//show: false,
data: [‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’]
}],
yAxis: [{//第一个y轴位置在左侧
position:‘left’,
type : ‘value’,
name: ‘单位数’,
// data:[‘0’,‘10’,‘20’,‘30’]
},
{//第二个y轴在右侧
position:‘right’,
type : ‘value’,
name: ‘职工数’,
//show: false
},
],
series: [ {
name:‘单位数’,
type:‘line’,
barMaxWidth:‘20%’,
label:{
normal:{
show:true,
position:‘top’
}
},
yAxisIndex:‘0’,//使用第一个y轴,序号从0开始
xAxisIndex:‘1’,//使用第二个x轴,序号从0开始
data: [23,27,28,30,34,36,39,41,45,46,56,60]
},
{
name:‘职工数’,
type:‘bar’,
barMaxWidth:‘20%’,
label:{
normal:{
show:true,
position:‘top’
}
},
yAxisIndex:‘1’,//使用第二个y轴
data:[1500,1700,1750,1800,1850,1900,1910,1941,1980,2000,2100,2200]
}
]
};## Echarts多X轴 多Y轴