You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/10/12 05:31:11 UTC

[GitHub] mzy2240 opened a new issue #9212: For Map Application, update the scatter data will erase all the lines data

mzy2240 opened a new issue #9212: For Map Application, update the scatter data will erase all the lines data
URL: https://github.com/apache/incubator-echarts/issues/9212
 
 
   <!--
   为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
   -->
   
   
   ### One-line summary [问题简述]
   For Map Application, update the scatter data will erase all the lines data
   
   
   
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]: ~4.10
   + Browser version [浏览器类型和版本]: Version 69.0.3497.100
   + OS Version [操作系统类型和版本]: Win10 Professional
   
   
   
   
   
   ### Expected behaviour [期望结果]
   Update part of the scatter data will not affect the rendered lines.
   
   
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   ```javascript
   option = {
   animation: false,
   				tooltip: {
   					show: true,
   					trigger: 'item'
   				},
   				leaflet: {
   					center: [-86.0, 36.44],
   					zoom: 6,
   					roam: true,
   					tiles: [
   						{
   							label: 'OpenStreetMap',
   							urlTemplate:
   								'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
   							options: {
   								attribution:
   									'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
   							}
   						}
   					]
   				},
   				series: [
   					{
   						id: 'sub',
   						type: 'scatter',
   						name: 'sub',
   						coordinateSystem: 'leaflet',
   						symbol: 'circle',
   						symbolSize: 7,
   						// showEffectOn: 'emphasis',
   						// zindex: 2,
   						data: [],
   						tooltip: {
   							confine: true,
   							formatter: function(params) {
   								return 'Substation: ' + params.name;
   							}
   						},
   						itemStyle: {
   							color: 'rgb(200, 40, 0)'
   						}
   					},
   					{
   						id: 'lines',
   						name: 'lines',
   						type: 'lines',
   						coordinateSystem: 'leaflet',
   						silent: false,
   						lineStyle: {
   							width: 1,
   							// color: 'rgb(200, 40, 0)',
   							color: function(params) {
   								let temp;
   								// console.log(params.data.attributes.volt)
   								switch (params.data.attributes.volt) {
   									case 230:
   										temp = '#3949ab';
   										break;
   									case 500:
   										temp = '#e53935';
   										break;
   								}
   								// console.log(params.data.attributes.volt);
   								return temp;
   							},
   							opacity: 1
   						},
   						tooltip: {
   							// position: [10, 10],
   							confine: true,
   							formatter: function(params) {
   								return 'Branch: ' + params.name;
   							}
   						},
   						emphasis: {
   							lineStyle: {
   								width: 2,
   								shadowColor: 'rgba(144, 144, 255, 0.5)',
   								shadowBlur: 10
   							}
   						},
   						data: []
   					},
   					{
   						id: 'vbus',
   						name: 'vbus',
   						type: 'scatter',
   						coordinateSystem: 'leaflet',
   						silent: false,
   						symbol: 'pin',
   						symbolSize: 50,
   						zindex: 2,
   						itemStyle: {
   							color: '#ff6d00'
   						},
   						data: []
   					},
   					{
   						id: 'shunt',
   						name: 'shunt',
   						type: 'scatter',
   						coordinateSystem: 'leaflet',
   						silent: false,
   						symbol: 'rect',
   						symbolSize: 50,
   						zindex: 3,
   						itemStyle: {
   							color: '#4caf50'
   						},
   						data: []
   					}
   				]
   
   }
   
   ```
   
   
   
   
   ### Other comments [其他信息]
   <!-- For example: Screenshot or Online demo -->
   <!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
   If need, you can use bmap and you will meet the same issue. For example, if you first render the first two series by giving them data and setOption, and then update the data to any of the last two series by setoption({series: [{
   id: 'shunt',
   name: 'shunt',
   data: [{
   name: 'blah',
   value: [-86, 40] //for example
   }]
   }]})
   then you will find the scatter in series 0 still there but the lines in series 1 disapper. Need help to fix this bug! Thanks!!! 
   
   

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


With regards,
Apache Git Services

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