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/02/19 07:45:07 UTC

[GitHub] [echarts] lvding opened a new issue #14293: 配置项series.data数组里如果同时存在null和对象,将会报错Cannot read property 'selected' of null

lvding opened a new issue #14293:
URL: https://github.com/apache/echarts/issues/14293


   ### Version
   5.0.2
   
   ### Steps to reproduce
   非连续的折线图/柱状图,在3.x和4.x版本时,
   series.data可以用类似[null,{value:3},{value:4},null]这样的数组呈现,而在5.x版本时候必须使用[{value:null},{value:3},{value:4},{value:null}]
   否则将会报错Cannot read property 'selected' of null
   
   ### What is expected?
   正常呈现非连续的折线图
   
   ### What is actually happening?
   报错Cannot read property 'selected' of null
   
   <!-- 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:
users@infra.apache.org



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


[GitHub] [echarts] leosxie commented on issue #14293: 配置项series.data数组里如果同时存在null和对象,将会报错Cannot read property 'selected' of null

Posted by GitBox <gi...@apache.org>.
leosxie commented on issue #14293:
URL: https://github.com/apache/echarts/issues/14293#issuecomment-789362670


   i will try to pr this issue


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


[GitHub] [echarts] echarts-bot[bot] commented on issue #14293: 配置项series.data数组里如果同时存在null和对象,将会报错Cannot read property 'selected' of null

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #14293:
URL: https://github.com/apache/echarts/issues/14293#issuecomment-787601476


   This issue is labeled with `difficulty: easy`.
   @lvding Would you like to debug it by yourself? This is a quicker way to get your problem fixed. Or you may wait for the community to fix.
   
   Please have a look at [How to debug ECharts](https://github.com/apache/incubator-echarts/blob/master/CONTRIBUTING.md#how-to-debug-echarts) if you'd like to give a try. 🤓


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


[GitHub] [echarts] echarts-bot[bot] commented on issue #14293: 配置项series.data数组里如果同时存在null和对象,将会报错Cannot read property 'selected' of null

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #14293:
URL: https://github.com/apache/echarts/issues/14293#issuecomment-781897583


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that **you have posted enough image to demo your request**. You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
   
   If you are interested in the project, you may also subscribe our [mailing list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵


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


[GitHub] [echarts] pissang closed issue #14293: 配置项series.data数组里如果同时存在null和对象,将会报错Cannot read property 'selected' of null

Posted by GitBox <gi...@apache.org>.
pissang closed issue #14293:
URL: https://github.com/apache/echarts/issues/14293


   


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


[GitHub] [echarts] plainheart commented on issue #14293: 配置项series.data数组里如果同时存在null和对象,将会报错Cannot read property 'selected' of null

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #14293:
URL: https://github.com/apache/echarts/issues/14293#issuecomment-791042981


   Great! Like #14404, y'all got the focus of this error. Any contribution will be much appreciated!


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


[GitHub] [echarts] jonavila commented on issue #14293: 配置项series.data数组里如果同时存在null和对象,将会报错Cannot read property 'selected' of null

Posted by GitBox <gi...@apache.org>.
jonavila commented on issue #14293:
URL: https://github.com/apache/echarts/issues/14293#issuecomment-790918020


   I ran into this issue in 5.x and I believe it's caused by this method of Series.ts
   
   
   ```
   private _initSelectedMapFromData(data: List) {
           // Ignore select info in data if selectedMap exists.
           // NOTE It's only for legacy usage. edge data is not supported.
           if (this.option.selectedMap) {
               return;
           }
   
           const dataIndices: number[] = [];
           if (data.hasItemOption) {
               data.each(function (idx) {
                   const rawItem = data.getRawDataItem(idx);
                   if (typeof rawItem === 'object'
                       && (rawItem as OptionDataItemObject<unknown>).selected
                   ) {
                       dataIndices.push(idx);
                   }
               });
           }
   
           if (dataIndices.length > 0) {
               this._innerSelect(data, dataIndices);
           }
       }
       
   ```
   You can see how it fails if rawItem is null because typeof null === 'object'.
   
   Using  undefined in the value instead of null works for me as workaround.
   
   
   


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