Shu-Ji opened a new issue #14534:
URL: https://github.com/apache/echarts/issues/14534


   ### Version
   5.0.2
   
   ### Reproduction link
   
[https://codesandbox.io/s/echart-areastyle-null-error-r37t0?file=/src/index.js](https://codesandbox.io/s/echart-areastyle-null-error-r37t0?file=/src/index.js)
   
   ### Steps to reproduce
   面积图中有两条线:
   由于需求要求同环比,就会存在:本周有数据,但是上周可能没数据的情况
   即 series 中有一个线有数据,有一条线(上周)没有数据,全是 null
   此时折线图是可以成功的,普通面积图也是成功的,但是面积图使用渐变色(color属性)后会报错:
   
   经查验,只有当所有 value 都是非 number 时就会报错,只要其中有一个
   value 是数字,那么就不会报错了
   
   请参考复现链接:
   
   ```javascript
   series: [
           {
               name: '会员数-周同比',
               type: 'line',
               data: [
                   // 由于需求要求同环比,就会存在,本周有数据
                   // 但是上周没数据的情况
                   // 即series 中有一个线有数据,有一条线(上周)没有数据,全是 null
                   // 此时折线图是可以成功的,但是面积图使用渐变色(color属性)后会报错
   
                   // 经查验,只有当所有 value 都是非 number 时就会报错,只要其中有一个
                   // value 是数字,那么就不会报错了
                   {
                       value: null
                   },
                   {
                       value: null
                   }
               ],
               areaStyle: {
                   // 把这个渐变的 color 属性注释掉就不报错了
                   color: {
                       type: 'linear',
                       x: 0,
                       y: 0,
                       x2: 0,
                       y2: 1,
                       index: 6,
                       colorStops: [
                           {
                               offset: 0,
                               color: 'rgba(235,83,46, 0.30)'
                           },
                           {
                               offset: 1,
                               color: 'rgba(235,83,46, 0.05)'
                           }
                       ]
                   }
               }
           }
       ]
   ```
   
   ### What is expected?
   面积图使用颜色渐变后,某个 serie 如果 value 中没有一个是数字,也不要报错。
   
   ### What is actually happening?
   面积图使用颜色渐变后,某个 serie 如果 value 中没有一个是数字,报错了。
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to