zhans1099 opened a new issue #9380: 版本4中当属于一个y轴的系列在legend中关闭时,该y轴如何自动隐藏,而不是只隐藏数字
URL: https://github.com/apache/incubator-echarts/issues/9380
 
 
   <!--
   为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
   -->
   
   
   ### One-line summary [问题简述]
   
版本4中当属于一个y轴的系列在legend中关闭时,该y轴如何自动隐藏,而不是只隐藏数字,如果只有一个Y轴的时候问题不大,但是当存在多个Y轴时,就会有这样的需求。
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]: 4.2.0
   + Browser version [浏览器类型和版本]: 版本 70.0.3538.77 (64 位)
   + OS Version [操作系统类型和版本]:  Mac OS 10.14.1
   
   ### Expected behaviour [期望结果]
   期望在影藏legend中的数据时,对应的Y轴也跟着隐藏
   
   
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 
option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   ```javascript
   
   app.title = '多 Y 轴示例';
   
   var colors = ['#5793f3', '#d14a61', '#675bba'];
   
   option = {
       color: colors,
   
       tooltip: {
           trigger: 'axis',
           axisPointer: {
               type: 'cross'
           }
       },
       grid: {
           right: '20%'
       },
       toolbox: {
           feature: {
               dataView: {show: true, readOnly: false},
               restore: {show: true},
               saveAsImage: {show: true}
           }
       },
       legend: {
           data:['蒸发量','降水量','平均温度']
       },
       xAxis: [
           {
               type: 'category',
               axisTick: {
                   alignWithLabel: true
               },
               data: 
['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
           }
       ],
       yAxis: [
           {
               type: 'value',
               name: '蒸发量',
               position: 'right',
               axisLine: {
                   lineStyle: {
                       color: colors[0]
                   }
               },
               axisLabel: {
                   formatter: '{value} ml'
               }
           },
           {
               type: 'value',
               name: '降水量',
               position: 'right',
               offset: 80,
               axisLine: {
                   lineStyle: {
                       color: colors[1]
                   }
               },
               axisLabel: {
                   formatter: '{value} ml'
               }
           },
           {
               type: 'value',
               name: '温度',
               position: 'left',
               axisLine: {
                   lineStyle: {
                       color: colors[2]
                   }
               },
               axisLabel: {
                   formatter: '{value} °C'
               }
           }
       ],
       series: [
           {
               name:'蒸发量',
               type:'bar',
               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:'bar',
               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]
           }
       ]
   };
   
   ```
   
   
   
   
   ### Other comments [其他信息]
   <!-- For example: Screenshot or Online demo -->
   <!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
   
   

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


With regards,
Apache Git Services

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

Reply via email to