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/18 05:55:57 UTC

[GitHub] fangwa opened a new issue #9250: svg渲染模式下,setOption控制series的label的显示show属性无效

fangwa opened a new issue #9250: svg渲染模式下,setOption控制series的label的显示show属性无效
URL: https://github.com/apache/incubator-echarts/issues/9250
 
 
   <!--
   为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
   -->
   
   
   ### One-line summary [问题简述]
   line图中,svg渲染时,setOption控制label的显示无效
   需求是系列太多,label会出现重叠,所以toolbox里加了个控制显示隐藏功能
   
   
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]:源码里怎么看echart和zrender的版本?能在抬头的注释里写下么~~
   + Browser version [浏览器类型和版本]:chrome
   + OS Version [操作系统类型和版本]:
   
   
   
   
   
   ### Expected behaviour [期望结果]
   能控制label的显示和隐藏
   
   
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   ```javascript
   var dom = document.getElementById("container");
   var myChart = echarts.init(dom, null, {renderer: 'svg'});
   //echarts.init(dom);  默认canvas是OK的
   var app = {};
   var check = false;
   option = null;
   option = {
       xAxis: {
           type: 'category',
           data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
       },
       yAxis: {
           type: 'value'
       },
       series: [{
           data: [820, 932, 901, 934, 1290, 1330, 1320],
           type: 'line'
       }],
       toolbox:{
           feature: {
               dataView: { show: true, readOnly: false },
               saveAsImage: { show: true },
               myTool1: {
                   show: true,
                   title: 'Lable',
                   icon: 'path://M432.45,595.444c0,2.177-4.661,6.82-11.305,6.82c-6.475,0-11.306-4.567-11.306-6.82s4.852-6.812,11.306-6.812C427.841,588.632,432.452,593.191,432.45,595.444L432.45,595.444z M421.155,589.876c-3.009,0-5.448,2.495-5.448,5.572s2.439,5.572,5.448,5.572c3.01,0,5.449-2.495,5.449-5.572C426.604,592.371,424.165,589.876,421.155,589.876L421.155,589.876z M421.146,591.891c-1.916,0-3.47,1.589-3.47,3.549c0,1.959,1.554,3.548,3.47,3.548s3.469-1.589,3.469-3.548C424.614,593.479,423.062,591.891,421.146,591.891L421.146,591.891zM421.146,591.891',
                   onclick: function () {
   					check = !check;
                       myChart.setOption({
                           series: [{ label: { show: check}}]
                       });
                   }
               }
           }
       }
   };
   ;
   if (option && typeof option === "object") {
       myChart.setOption(option, true);
   }
   
   ```
   
   
   
   
   ### 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:
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