mzy2240 edited a comment on issue #9212: For Map Application, update the 
scatter data will erase all the lines data
URL: 
https://github.com/apache/incubator-echarts/issues/9212#issuecomment-434378685
 
 
   Hi Ovilia, for some reason I cannot use the gallery.echartsjs.com to 
reproduce the case, however, you can use the official example 
**http://echarts.baidu.com/examples/editor.html?c=map-polygon** and copy/paste 
the following code to **replace the original codes from line 433 to the end**. 
Here are what you should expect: **a wide line on the map from 拉萨 to 大庆**. If 
you can see that, then **uncomment the last 7 lines of code**, which is 
supposed to only update the scatter data, you will notice that **the line 
disappears**, which does not make sense to me. Scatters and lines have been 
placed on **different z-level**, but it has no effect on the line's disappear. 
Hopefully this time I make it clear enough. Thanks! @Ovilia @100pah 
   
   `myChart.setOption({
       title: {
           text: '全国主要城市空气质量',
           subtext: 'data from PM25.in',
           sublink: 'http://www.pm25.in',
           left: 'center',
           textStyle: {
               color: '#fff'
           }
       },
       tooltip: {
           trigger: 'item'
       },
       bmap: {
           center: [104.114129, 37.550339],
           zoom: 5,
           roam: true
       },
       series: [{
               id: 'scatter',
               name: 'pm2.5',
               type: 'scatter',
               zlevel: 0,
               coordinateSystem: 'bmap',
               data: [], //convertData(data),
               symbolSize: function(val) {
                   return val[2] / 10;
               },
               label: {
                   normal: {
                       formatter: '{b}',
                       position: 'right',
                       show: false
                   },
                   emphasis: {
                       show: true
                   }
               },
               itemStyle: {
                   normal: {
                       color: '#ddb926'
                   }
               }
           },
           {
               name: 'Top 5',
               type: 'effectScatter',
               coordinateSystem: 'bmap',
               data: convertData(data.sort(function(a, b) {
                   return b.value - a.value;
               }).slice(0, 6)),
               symbolSize: function(val) {
                   return val[2] / 10;
               },
               showEffectOn: 'emphasis',
               rippleEffect: {
                   brushType: 'stroke'
               },
               hoverAnimation: true,
               label: {
                   normal: {
                       formatter: '{b}',
                       position: 'right',
                       show: true
                   }
               },
               itemStyle: {
                   normal: {
                       color: '#f4e925',
                       shadowBlur: 10,
                       shadowColor: '#333'
                   }
               },
               zlevel: 1
           },
           {
               type: 'custom',
               coordinateSystem: 'bmap',
               zlevel: 0,
               renderItem: renderItem,
               itemStyle: {
                   normal: {
                       opacity: 0.5
                   }
               },
               animation: false,
               silent: true,
               data: [0],
               z: -10
           },
           {
               name: 'lines',
               type: 'lines',
               coordinateSystem: 'bmap',
               zlevel: 2,
               data: [{
                   name: 'test',
                   coords: [
                       [91.11, 29.97],
                       [125.03, 46.58]
                   ]
               }],
               lineStyle: {
                   normal: {
                       color: '#000000',
                       width: 5,
                   }
               }
           }
       ]
   });
   // myChart.setOption({
   // series: [{
   // id: 'scatter',
   // name: 'pm2.5',
   // data: convertData(data)
   // }]
   // });`

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to