app.title = '多 Y 轴示例';

var colors = ['#a62ca6', '#8e0515', '#45baf3','#ff2420','#1a9a1a'];

option = {
    color: colors,

    tooltip: {
        trigger: 'axis'
    },
    grid: {
        right: '20%'
    },
    toolbox: {
        feature: {
            dataView: {show: true, readOnly: false},
            restore: {show: true},
            saveAsImage: {show: true}
        }
    },
    xAxis: [
        {
            type: 'category',
            axisTick: {
                alignWithLabel: true
            },
            data: ['200rpm','400rpm','600rpm','800rpm','1000rpm','1200rpm','1400rpm','1600rpm','1800rpm','2000rpm','2200rpm']
        }
    ],
    yAxis: [
        {
            type: 'value',
            name: '扭矩',
            min: 0,
            max: 3.2,
            position: 'left',
            offset:40,
            axisLine: {
                lineStyle: {
                    color: colors[0]
                }
            },
            axisLabel: {
                formatter: '{value} N*m'
            }
        },
        {
            type: 'value',
            name: '电压',
            min: 0,
            max: 220,
            position: 'left',
            offset: 0,
            axisLine: {
                lineStyle: {
                    color: colors[1]
                }
            },
            axisLabel: {
                formatter: '{value} V'
            }
        },
        {
            type: 'value',
            name: '输入功率',
            min: 0,
            max: 1450,
            position: 'left',
            offset:-40,
            axisLine: {
                lineStyle: {
                    color: colors[2]
                }
            },
            axisLabel: {
                formatter: '{value} W'
            }
        },
        {
            type: 'value',
            name: '电流',
            min: 0,
            max: 6.5,
            position: 'left',
            offset:-80,
            axisLine: {
                lineStyle: {
                    color: colors[3]
                }
            },
            axisLabel: {
                formatter: '{value} A'
            }
        },
        {
            type: 'value',
            name: '效率',
            min: 0,
            max: 81,
            position: 'left',
            offset:-120,
            axisLine: {
                lineStyle: {
                    color: colors[4]
                }
            },
            axisLabel: {
                formatter: '{value} %'
            }
        }
    ],
    series: [
        {
            name:'扭矩',
            type:'line',
            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:'line',
            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]
        },
        {
            name:'电流',
            type:'line',
            yAxisIndex: 3,
            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]
        },
        {
            name:'效率',
            type:'line',
            yAxisIndex: 4,
            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]
        }
    ]
};

