Echarts 多Y轴设置


option = {
    legend: {},
    tooltip: [{
	 trigger: 'item',
        axisPointer: {
            type: 'cross'
        }
	}],
    dataset: [{
        dimensions: ['product', '2015', '2016', '2017'],
        source: [
            {product: 'Matcha Latte', '2015': 43.3, '2016': 85.8, '2017': 93.7},
            {product: 'Milk Tea', '2015': 83.1, '2016': 73.4, '2017': 55.1},
            {product: 'Cheese Cocoa', '2015': 86.4, '2016': 65.2, '2017': 82.5},
            {product: 'Walnut Brownie', '2015': 72.4, '2016': 53.9, '2017': 39.1}
        ]
    },
	{dimensions: ['product', '2015', '2016', '2017'],
        source: [
            {product: 'Matcha Latte', '2015': 30.3, '2016': 77.8, '2017': 60.7},
            {product: 'Milk Tea', '2015': 70.1, '2016': 88.4, '2017': 62.1},
            {product: 'Cheese Cocoa', '2015': 55.4, '2016': 99.2, '2017': 47.5},
            {product: 'Walnut Brownie', '2015': 66.4, '2016': 100.9, '2017': 35.1}
        ]
    },{dimensions: ['product', '2015', '2016', '2017'],
        source: [
            {product: 'Matcha Latte', '2015': 30.3, '2016': 77.8, '2017': 60.7},
            {product: 'Milk Tea', '2015': 70.1, '2016': 88.4, '2017': 62.1},
            {product: 'Cheese Cocoa', '2015': 55.4, '2016': 99.2, '2017': 47.5},
            {product: 'Walnut Brownie', '2015': 66.4, '2016': 100.9, '2017': 35.1}
        ]
    },{dimensions: ['product', '2015', '2016', '2017'],
        source: [
            {product: 'Matcha Latte', '2015': 30.3, '2016': 77.8, '2017': 60.7},
            {product: 'Milk Tea', '2015': 70.1, '2016': 88.4, '2017': 62.1},
            {product: 'Cheese Cocoa', '2015': 55.4, '2016': 99.2, '2017': 47.5},
            {product: 'Walnut Brownie', '2015': 66.4, '2016': 100.9, '2017': 35.1}
        ]
    }
	],
    xAxis: [{type: 'category'}],
          "yAxis": [
            {//第一个y轴位置在左侧
                position:'left',
                type : 'value',
                name: '求和1',
                axisLine: {
                show: true,
				 lineStyle: {
                    color: "#c23531"
                }
            },
                axisLabel: {
                    formatter: '{value} '
                }
            },
            {//第二个y轴在右侧
                position:'right',
                type : 'value',
                name: '求和2',
                axisLine: {
                show: true
            },
                axisLabel: {
                    formatter: '{value} '
                }
            },
			{//第三个y轴在右侧
                position:'right',
                type : 'value',
                offset: 40,
				name: '求和3',
                axisLine: {
                show: true
            },
                axisLabel: {
                    formatter: '{value} '
                }
            },
			{//第三个y轴在右侧
                position:'left',
                type : 'value',
                offset: 40,
				name: '求和4',
                axisLine: {
                show: true
            },
                axisLabel: {
                    formatter: '{value} '
                }
            }
        ],
    // Declare several bar series, each will be mapped
    // to a column of dataset.source by default.
    series: [
        
	    {type: 'bar',datasetIndex: 0,yAxisIndex:0},
        {type: 'bar',datasetIndex: 0,yAxisIndex:0},
        {type: 'bar',datasetIndex: 0,yAxisIndex:0},
		{type: 'bar',datasetIndex: 1,yAxisIndex:1},
        {type: 'bar',datasetIndex: 1,yAxisIndex:1},
        {type: 'bar',datasetIndex: 1,yAxisIndex:1},
		{type: 'bar',datasetIndex: 2,yAxisIndex:2},
        {type: 'bar',datasetIndex: 2,yAxisIndex:2},
        {type: 'bar',datasetIndex: 2,yAxisIndex:2},
		{type: 'bar',datasetIndex: 3,yAxisIndex:3},
        {type: 'bar',datasetIndex: 3,yAxisIndex:3},
        {type: 'bar',datasetIndex: 3,yAxisIndex:3}
		]
};
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值