You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/03/25 12:48:33 UTC

[GitHub] [echarts] echarts-bot[bot] edited a comment on issue #14534: TypeError Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.

echarts-bot[bot] edited a comment on issue #14534:
URL: https://github.com/apache/echarts/issues/14534#issuecomment-806645681


   @Shu-Ji It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **BODY**
   
   ### 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
   There are two lines in the area chart:
   Since the demand requirements are the same month-on-month, there will be a situation where there is data this week, but there may be no data last week
   That is, one line in series has data, one line (last week) has no data, all are null
   At this point, the line chart can be successful, and the ordinary area chart is also successful, but the area chart will report an error after using the gradient color (color attribute):
   
   After inspection, an error will be reported only when all values ​​are non-number, as long as one of them
   value is a number, then no error will be reported
   
   Please refer to the recurring link:
   
   ```javascript
   series: [
           {
               name:'Number of members-weekly year-on-year',
               type:'line',
               data: [
                   // Since the demand requirements are the same month-on-month, it will exist, and there is data this week
                   // but no data last week
                   // That is, one line in the series has data, and one line (last week) has no data, all are null
                   // At this point, the line chart can be successful, but the area chart will report an error after using the gradient color (color attribute)
   
                   // After inspection, an error will be reported only when all values ​​are non-number, as long as one of them
                   // value is a number, then no error will be reported
                   {
                       value: null
                   },
                   {
                       value: null
                   }
               ],
               areaStyle: {
                   // Comment out the color property of this gradient and no error will be reported
                   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)'
                           }
                       ]
                   }
               }
           }
       ]
   ```
   
   Because here getBoundingRect got the min and max are infinite, resulting in errors in the subsequent calculations:
   ![image](https://user-images.githubusercontent.com/1127594/112474817-0c498180-8dab-11eb-849d-bc187a8c8b51.png)
   
   
   ### What is expected?
   After the area chart uses the color gradient, if none of the value in a certain serie is a number, don't report an error.
   
   ### What is actually happening?
   After the area chart uses a color gradient, if none of the value in a certain serie is a number, an error is reported.
   </details>


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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org