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/08/13 08:30:39 UTC

[GitHub] wangyx233 opened a new issue #8862: v4.1.0 datazoom 'toFixed of null' error

wangyx233 opened a new issue #8862: v4.1.0 datazoom 'toFixed of null' error
URL: https://github.com/apache/incubator-echarts/issues/8862
 
 
   <!--
   为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
   -->
   
   
   ### One-line summary [问题简述]
   
   3.8.5版本切换到4.1.0时有报错‘TypeError: Cannot read property 'toFixed' of null’。排查后发现,xAxis的data为[],而datazoom的startValue,endValue为string类型的值时会触发。3.8.5版本则无报错。
   现在是给xAxis的data赋值后,再设置datazoom的startValue和endValue可以避免这个问题。
   
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]: 4.1.0
   + Browser version [浏览器类型和版本]: Chrome 版本 68.0.3440.84(正式版本) (64 位)
   + OS Version [操作系统类型和版本]: macOS High Sierra 10.13.3
   
   
   
   
   
   ### Expected behaviour [期望结果]
   
   
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   ```javascript
   option = {
       xAxis: {
           type: 'category',
           data: []
       },
       yAxis: {
           type: 'value',
           data: []
       },
       dataZoom: [
           {
               type: 'slider',
               show: true,
               xAxisIndex: [0],
               startValue: '1日',
               endValue: '5日'
           },
       ],
       series: [
           {
               name: 'test',
               type: 'line',
               data: []
           },
       ]
   }
   
   ```
   
   
   
   
   ### Other comments [其他信息]
   <!-- For example: Screenshot or Online demo -->
   <!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
   
   ![image](https://user-images.githubusercontent.com/16773666/44020092-58104d44-9f13-11e8-93a3-0ed75b520133.png)
   对照3.8.5版本的代码,valueWindow->[-1,-1]
   ![image](https://user-images.githubusercontent.com/16773666/44020194-b969208e-9f13-11e8-8e4e-525a004d2a0b.png)
   4.1.0:valueWindow->[null,null] 所以有上述报错。
   ![image](https://user-images.githubusercontent.com/16773666/44020382-4d0207fc-9f14-11e8-8773-35968b683464.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