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/05/17 12:58:57 UTC

[GitHub] peryang opened a new issue #8359: 图例和曲线显示顺序不一致

peryang opened a new issue #8359: 图例和曲线显示顺序不一致
URL: https://github.com/apache/incubator-echarts/issues/8359
 
 
   <!--
   为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
   -->
   
   
   ### One-line summary [问题简述]
   图例和曲线显示顺序
   
   
   
   
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]:
   + Browser version [浏览器类型和版本]:
   + OS Version [操作系统类型和版本]:
   http://echarts.baidu.com/examples/editor.html?c=line-simple
   chrome
   windows
   
   
   
   
   ### Expected behaviour [期望结果]
   顺序一致
   
   
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   需要执行两段代码,用到了两次setOption,代码如下
   
   1、第一段
   ```javascript
   var myChart = echarts.init($("#chart-panel")[0]);
   myChart.setOption({"title":{"text":""},"tooltip":{"trigger":"axis"},"legend":{"type":"scroll","data":["2018-05-16","2018-05-15","2018-05-09"],"left":"left","icon":"rect","itemWidth":15,"orient":"horizontal","align":"left","width":"auto","padding":[0,20],"pageIconColor":"#6d7ac9","pageIconInactiveColor":"#eceffa","tooltip":{"show":true}},"grid":{"top":"15%","left":"3%","right":"4%","bottom":"3%","containLabel":true},"toolbox":{},"xAxis":{"type":"category","data":["A","B","C","D","E","F","G","H","I","J"],"showAllSymbol":false,"splitNumber":0,"silent":false,"interval":0,"axisLabel":{"interval":"auto","show":true,"splitNumber":0},"axisTick":{"interval":0}},"yAxis":{"type":"value","axisLabel":{"formatter":"{value}"}},"series":[{"name":"2018-05-16","type":"bar","stack":"2018-05-16","data":[471, 128, 862, 492, 598, 479, 72, 738, 323, 68]},{"name":"2018-05-15","type":"bar","stack":"2018-05-15","data":[359, 846, 446, 180, 478, 931, 20, 676, 434, 607]},{"name":"2018-05-09","type":"bar","stack":"2018-05-09","data":[488, 791, 997, 964, 882, 287, 634, 840, 626, 202]}]});
   
   ```
   1、第二段
   ```javascript
   myChart.setOption({"title":{"text":""},"tooltip":{"trigger":"axis"},"legend":{"type":"scroll","data":["2018-05-10","2018-05-09","2018-05-03"],"left":"left","icon":"rect","itemWidth":15,"orient":"horizontal","align":"left","width":"auto","padding":[0,20],"pageIconColor":"#6d7ac9","pageIconInactiveColor":"#eceffa","tooltip":{"show":true}},"grid":{"top":"15%","left":"3%","right":"4%","bottom":"3%","containLabel":true},"toolbox":{},"xAxis":{"type":"category","data":["A","B","C","D","E","F","G","H","I","J"],"showAllSymbol":false,"splitNumber":0,"silent":false,"interval":0,"axisLabel":{"interval":"auto","show":true,"splitNumber":0},"axisTick":{"interval":0}},"yAxis":{"type":"value","axisLabel":{"formatter":"{value}"}},"series":[{"name":"2018-05-10","type":"bar","stack":"2018-05-10","data":[142, 185, 590, 446, 165, 177, 246, 101, 235, 771]},{"name":"2018-05-09","type":"bar","stack":"2018-05-09","data":[880, 486, 422, 400, 216, 580, 173, 977, 757, 41]},{"name":"2018-05-03","type":"bar","stack":"2018-05-03","data":[0,0,0,0,0,0,0,0,0,0]}]});
   
   ```
   
   
   
   ### Other comments [其他信息]
   <!-- For example: Screenshot or Online demo -->
   <!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
   第一段代码执行结果:
   
   ![image](https://user-images.githubusercontent.com/12420973/40178776-0f40e5bc-5a15-11e8-9490-ce08677a7d0f.png)
   
   
   第二段代码执行结果:
   ![image](https://user-images.githubusercontent.com/12420973/40178794-195ebe84-5a15-11e8-93de-68c55f304a72.png)
   
   
   
   
   

----------------------------------------------------------------
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