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 2020/11/24 04:03:36 UTC

[GitHub] [incubator-echarts] dirslashls opened a new issue #13673: Cannot read property __ec_inner_ of undefined error with geo coordinate system

dirslashls opened a new issue #13673:
URL: https://github.com/apache/incubator-echarts/issues/13673


   ### Version
   5.0.0
   
   ### Steps to reproduce
   Please try the following on version 5.
   
   1) Copy the code at https://echarts.apache.org/examples/en/editor.html?c=map-usa but use it again 5.0 library.
   2) In the options, add 
   ```
   		geo: {
   			map: 'USA'
   		},
   ```
   
   ### What is expected?
   Clicking any region on the map shouldn't throw error and call mouse event if registered.
   
   ### What is actually happening?
   Throws the following error.
   
   Uncaught TypeError: Cannot read property '__ec_inner_3' of undefined
       at echarts.js:16382
       at GeoView._handleRegionClick (echarts.js:65775)
       at Group.Eventful.trigger (echarts.js:1149)
       at Handler.dispatchToElement (echarts.js:1729)
       at Handler.<computed> [as click] (echarts.js:1823)
       at HandlerDomProxy.Eventful.trigger (echarts.js:1149)
       at HandlerDomProxy.localDOMHandlers.<computed> (echarts.js:7110)
       at HTMLDivElement.<anonymous> (echarts.js:7163)
   
   ---
   Note that if you don't have the geo coordinate system it works fine. I wanted to configure a few properties on the coordinate system instead of the individual series and that's how I ran into this problem.
   
   <!-- 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] [incubator-echarts] dirslashls commented on issue #13673: Cannot read property __ec_inner_ of undefined error with geo coordinate system

Posted by GitBox <gi...@apache.org>.
dirslashls commented on issue #13673:
URL: https://github.com/apache/incubator-echarts/issues/13673#issuecomment-732731710


   Please also add "geoIndex: 0" in the series options and you see the error.


----------------------------------------------------------------
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] [incubator-echarts] pissang commented on issue #13673: Cannot read property __ec_inner_ of undefined error with geo coordinate system

Posted by GitBox <gi...@apache.org>.
pissang commented on issue #13673:
URL: https://github.com/apache/incubator-echarts/issues/13673#issuecomment-732745971


   I can reproduce with the following option
   ```js
   myChart.showLoading();
   
   $.get(ROOT_PATH + '/data/asset/geo/USA.json', function (usaJson) {
       myChart.hideLoading();
   
       echarts.registerMap('USA', usaJson, {
           Alaska: {              // 把阿拉斯加移到美国主大陆左下方
               left: -131,
               top: 25,
               width: 15
           },
           Hawaii: {
               left: -110,        // 夏威夷
               top: 28,
               width: 5
           },
           'Puerto Rico': {       // 波多黎各
               left: -76,
               top: 26,
               width: 2
           }
       });
       option = {
           title: {
               text: 'USA Population Estimates (2012)',
               subtext: 'Data from www.census.gov',
               sublink: 'http://www.census.gov/popest/data/datasets.html',
               left: 'right'
           },
           tooltip: {
               trigger: 'item',
               showDelay: 0,
               transitionDuration: 0.2,
               formatter: function (params) {
                   var value = (params.value + '').split('.');
                   value = value[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,');
                   return params.seriesName + '<br/>' + params.name + ': ' + value;
               }
           },
           visualMap: {
               left: 'right',
               min: 500000,
               max: 38000000,
               inRange: {
                   color: ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']
               },
               text: ['High', 'Low'],           // 文本,默认为数值文本
               calculable: true
           },
           toolbox: {
               show: true,
               //orient: 'vertical',
               left: 'left',
               top: 'top',
               feature: {
                   dataView: {readOnly: false},
                   restore: {},
                   saveAsImage: {}
               }
           },
           geo: {
               map: 'USA',  
           },
           series: [
               {
                   name: 'USA PopEstimates',
                   type: 'map',
                   roam: true,
                   geoIndex: 0,
                   emphasis: {
                       label: {
                           show: true
                       }
                   },
                   // 文本位置修正
                   textFixed: {
                       Alaska: [20, -20]
                   },
                   data:[
                       {name: 'Alabama', value: 4822023},
                       {name: 'Alaska', value: 731449},
                       {name: 'Arizona', value: 6553255},
                       {name: 'Arkansas', value: 2949131},
                       {name: 'California', value: 38041430},
                       {name: 'Colorado', value: 5187582},
                       {name: 'Connecticut', value: 3590347},
                       {name: 'Delaware', value: 917092},
                       {name: 'District of Columbia', value: 632323},
                       {name: 'Florida', value: 19317568},
                       {name: 'Georgia', value: 9919945},
                       {name: 'Hawaii', value: 1392313},
                       {name: 'Idaho', value: 1595728},
                       {name: 'Illinois', value: 12875255},
                       {name: 'Indiana', value: 6537334},
                       {name: 'Iowa', value: 3074186},
                       {name: 'Kansas', value: 2885905},
                       {name: 'Kentucky', value: 4380415},
                       {name: 'Louisiana', value: 4601893},
                       {name: 'Maine', value: 1329192},
                       {name: 'Maryland', value: 5884563},
                       {name: 'Massachusetts', value: 6646144},
                       {name: 'Michigan', value: 9883360},
                       {name: 'Minnesota', value: 5379139},
                       {name: 'Mississippi', value: 2984926},
                       {name: 'Missouri', value: 6021988},
                       {name: 'Montana', value: 1005141},
                       {name: 'Nebraska', value: 1855525},
                       {name: 'Nevada', value: 2758931},
                       {name: 'New Hampshire', value: 1320718},
                       {name: 'New Jersey', value: 8864590},
                       {name: 'New Mexico', value: 2085538},
                       {name: 'New York', value: 19570261},
                       {name: 'North Carolina', value: 9752073},
                       {name: 'North Dakota', value: 699628},
                       {name: 'Ohio', value: 11544225},
                       {name: 'Oklahoma', value: 3814820},
                       {name: 'Oregon', value: 3899353},
                       {name: 'Pennsylvania', value: 12763536},
                       {name: 'Rhode Island', value: 1050292},
                       {name: 'South Carolina', value: 4723723},
                       {name: 'South Dakota', value: 833354},
                       {name: 'Tennessee', value: 6456243},
                       {name: 'Texas', value: 26059203},
                       {name: 'Utah', value: 2855287},
                       {name: 'Vermont', value: 626011},
                       {name: 'Virginia', value: 8185867},
                       {name: 'Washington', value: 6897012},
                       {name: 'West Virginia', value: 1855413},
                       {name: 'Wisconsin', value: 5726398},
                       {name: 'Wyoming', value: 576412},
                       {name: 'Puerto Rico', value: 3667084}
                   ]
               }
           ]
       };
   
       myChart.setOption(option);
   });
   ```
   


----------------------------------------------------------------
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] [incubator-echarts] dirslashls commented on issue #13673: Cannot read property __ec_inner_ of undefined error with geo coordinate system

Posted by GitBox <gi...@apache.org>.
dirslashls commented on issue #13673:
URL: https://github.com/apache/incubator-echarts/issues/13673#issuecomment-732640407


   Also note that this is a regression from 4.9


----------------------------------------------------------------
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] [incubator-echarts] pissang commented on issue #13673: Cannot read property __ec_inner_ of undefined error with geo coordinate system

Posted by GitBox <gi...@apache.org>.
pissang commented on issue #13673:
URL: https://github.com/apache/incubator-echarts/issues/13673#issuecomment-732746368


   Similar issue: https://lists.apache.org/thread.html/r32c27074a08c71b2f489476a5a9c3f05dd8bf829837fa45c02b1f0f5%40%3Cdev.echarts.apache.org%3E


----------------------------------------------------------------
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] [incubator-echarts] pissang commented on issue #13673: Cannot read property __ec_inner_ of undefined error with geo coordinate system

Posted by GitBox <gi...@apache.org>.
pissang commented on issue #13673:
URL: https://github.com/apache/incubator-echarts/issues/13673#issuecomment-754616999


   Seems it has been fixed in 5.0.0


----------------------------------------------------------------
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] [incubator-echarts] Ovilia commented on issue #13673: Cannot read property __ec_inner_ of undefined error with geo coordinate system

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #13673:
URL: https://github.com/apache/incubator-echarts/issues/13673#issuecomment-732726712


   Cannot reproduce with https://echarts.apache.org/next/examples/en/editor.html?c=map-usa which uses 5.0.0 rc version.


----------------------------------------------------------------
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] [incubator-echarts] pissang closed issue #13673: Cannot read property __ec_inner_ of undefined error with geo coordinate system

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


   


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