Yi-Frank commented on issue #9071: 
之前发错图了。一个grid实现双y轴展示2条line,每条y轴的name和对应的刻度对调了没匹配上
URL: 
https://github.com/apache/incubator-echarts/issues/9071#issuecomment-421312468
 
 
   ```javascript
   option = {
               backgroundColor: '#fff',
               axisPointer: {
                   link: {
                       xAxisIndex: 'all',
                   },
                   label: {
                       backgroundColor: '#777'
                   }
               },
               tooltip: {
                   trigger: 'axis',
               },
               grid: [
                   {
                       left: '40',
                       right: '40',
                       top: '5%',
                       height: '45%'
                   }
               ],
               xAxis:[
                   {
                       type: 'category',
                       name: '时间(s)',
                       data: xTime,
                       boundaryGap: false,
                       gridIndex: 0,
                       nameGap: 3,
                       nameLocation: 'end',
                       nameTextStyle:{
                           fontSize: 10
                       }
                   }
               ],
               yAxis:[
                   {
                       type: 'value',
                       gridIndex: 0,
                       name: '速度(km/h)',
                       nameGap: 10,
                       nameTextStyle:{
                           fontSize: 10
                       }
                   },
                   {
                       type: 'value',
                       name: '离合力度',
                       nameGap: 10,
                       gridIndex: 0,
                       nameTextStyle:{
                           fontSize: 10
                       }
                   }
               ],
               series: [
               {
                   name:'速度(km/h)',
                   type: 'line',
                   smooth: false,
                   data: p_data[0].analysis.speed_curves.S_Points,
                   xAxisIndex: 0,
                   yAxisIndex: 0,
                   lineStyle:{
                       color: 'rgb(26, 173, 25)',
                       width: 3,
                   },
                   itemStyle:{
                       color: 'rgb(26, 173, 25)',
                   },
                   zlevel: 1,
               },
               {
                   name:'离合力度',
                   type: 'line',
                   smooth: false,
                   data: p_data[0].analysis.clutch_curves.S_Points,
                   xAxisIndex: 0,
                   yAxisIndex: 1,
                   itemStyle:{
                       color: 'rgb(50, 50, 50)',
                   },
                   large: true,
                   zlevel: 1,
               },
           ]
   }
   ```
   
   
   上面那个太长了....

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to