apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.48k stars 19.62k forks source link

data points does not zoom with world map when progressive rendering is enabled #9298

Closed xulifan closed 3 years ago

xulifan commented 6 years ago

One-line summary [问题简述]

data points does not zoom with world map when progressive rendering is enabled

Version & Environment [版本及环境]

Expected behaviour [期望结果]

data points zoom with map

ECharts option [ECharts配置项]

myChart.setOption(option={
    backgroundColor: '#404a59',
    title : {
        text: 'User Distribution',
        left: 'center',
        top: 'top',
        textStyle: {
            color: '#fff'
        }
    },
    tooltip : {
        trigger: 'item',
        formatter : function (params) {
            var values = (params.value + '').split(',');
            var names = (params.name + '').split(',');

            name = names[0] + ', ' + names[1] + ' ('+ values[1] + 'N, ' + values[0] + 'E)'
            value = 'Count: ' + values[2]
            return name + '<br/>' + value;
        }
    },
    visualMap: {
        show: false,
        min: 0,
        max: max,
        inRange: {
            symbolSize: [4, 20] // circle size
        }
    },
    geo: {
        name: 'User Distribution',
        type: 'map',
        map: 'world',
        roam: true,
        show: true,
        selectedMode: 'single',
        label: {
            emphasis: {
                color: 'rgb(255, 255, 255)',
                show: true
            }
        },
        itemStyle: {
            normal: {
                areaColor: '#323c48',
                borderColor: '#111'
            },
            emphasis: {
                opacity: 0.4,
                areaColor: '#2a333d'
            }
        }
    },
    series : [
        {
            type: 'scatter',
            coordinateSystem: 'geo',
            // progressive rendering may cause the issue: datapoints does not zoom with map
            // Use large threshold to disable progressive rendering
            progressiveThreshold: 1000000000,
            zlevel: 4,
            // animation: true,
            data: mapData.map(function (itemOpt) {
                return {
                    name: [
                      itemOpt.city,
                      itemOpt.country
                    ],                    
                    value: [
                        latlong[itemOpt.key].longitude,
                        latlong[itemOpt.key].latitude,
                        itemOpt.value
                    ],
                    label: {
                        emphasis: {
                            position: 'right',
                            show: false
                        }
                    },
                    itemStyle: {
                        normal: {
                            color: itemOpt.color
                        }
                    }
                };
            })
        }
      ]
  }

Other comments [其他信息]

The progressive rendering is enabled when number of data is greater than progressiveThreshold which is 3000 by default. From my experiments, if number of data is between 3000 and 11000, the progressive rendering will not work when zooming.

100pah commented 5 years ago

Could I have your full option?

xulifan commented 5 years ago

Could I have your full option?

I have updated the options in my original post.

Ovilia commented 5 years ago

I didn't reproduce when I add progressiveThreshold: 1000000000 to the effectScatter in http://gallery.echartsjs.com/editor.html?c=xhmDTgZ5P_ . Could you please provide a full example at http://gallery.echartsjs.com/editor.html or jsfiddle?

xulifan commented 5 years ago

Hi, I have attached the code and the data for the zoom in issue.

data.zip

I didn't reproduce when I add progressiveThreshold: 1000000000 to the effectScatter in http://gallery.echartsjs.com/editor.html?c=xhmDTgZ5P_ . Could you please provide a full example at http://gallery.echartsjs.com/editor.html or jsfiddle?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 3 years ago

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!