You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/10/24 02:15:56 UTC

[GitHub] zhyt0520 commented on issue #9236: 多条折线的图,如何让坐标轴跟随曲线同步显示和隐藏

zhyt0520 commented on issue #9236: 多条折线的图,如何让坐标轴跟随曲线同步显示和隐藏
URL: https://github.com/apache/incubator-echarts/issues/9236#issuecomment-432487273
 
 
   抱歉,问题描述的过于简单
   
   示例配置
   <pre>option = {
       legend: {
           data:['一','二'],
           selectedMode:true
       },
       xAxis: {
           type: 'category',
           data: [1,2,3,4,5,6,7]
       },
       yAxis: [{
           type: 'value',
           id:'one',
           position:'left'
       },{
           type:'value',
           id:'two',
           position:'left',
           offset:50
       }],
       series: [{
           data: [820, 932, 901, 934, 1290, 1330, 1320],
           type: 'line',
           yAxisId:'one',
           name:'一'
       },{
           data: [123, 456, 654, 789, 582, 321, 523],
           type: 'line',
           yAxisId:'two',
           name:'二'
       }]
   };</pre>
   
   效果图一
   ![snipaste_20181024_100745](https://user-images.githubusercontent.com/10279099/47401631-b7862480-d774-11e8-97f6-0a5ebb3367a3.png)
   `legend`的selectedMode为默认true的时候,点击图例,可以让对应的曲线隐藏、显示
   效果图二
   ![snipaste_20181024_100802](https://user-images.githubusercontent.com/10279099/47401628-b7862480-d774-11e8-8b38-624406e7efe7.png)
   点击图例的【二】后,【二】这条曲线隐藏
   
   **希望达到的效果**
   
   **我希望点击图例的【二】后,曲线【二】和其对应的y轴(id:'two')同时隐藏,然后再次点击图例的时候二者再同时显示**
   
   查过配置手册,没找到现成的设置选项,不清楚目前是否支持我上述期望
   如果目前不支持直接设置中达到上述效果,希望大佬指点如何手动实现的上述效果的方向
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org