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

Heat point disappears and states with the same name are selected. #9166

Closed GibranLara closed 3 years ago

GibranLara commented 6 years ago

One-line summary [问题简述]

    • Heat point disappears when the cursor moves over the state.
    • States with the same name are selected.

Version & Environment [版本及环境]

Expected behaviour [期望结果]

  1. It is expected that the surface will not overlap at the point of heat that is marked. Is it possible that it is due to the number of shapes that are drawn on the map?

  2. Is there any other attribute that allows to differentiate states with the same name? If I have two features with the same name, when one is selected, both highlight.

ECharts option [ECharts配置项]

option = {
    title: {
        text: 'Mapa de calor', //Título principal del mapa
        subtext: 'Unidades de producción', //Subtítulo del mapa
        sublink: 'http://www.lahuerta.com.mx', //Link del subtítulo
        left: 'center',//Es la posición del mapa
        textStyle: {
            color: '#fff'// Aquí se le da el color el título 'Mapa de calor'
        }
    },
    backgroundColor: '#404a59',//Es el color del fondo excluyendo al trazo del mapa

    //Esta propiedad es tanto para el cálculo de los valores como para pintar las opciones en la parte inferior izquierda
    visualMap: {
        min: 0, //Este el valor mínimo del rango para pintar la regiones
        max: 1000, //Este es el valor máximo del rango para pintar las regiones
        splitNumber: 5, //Esta es las veces en las que se va a dividir el rango anterior
        inRange: {
            color: ['#d94e5d', '#eac736', '#50a3ba'].reverse() //Se saca el rango de los colores para hacer el efecto de degradación
        },
        textStyle: {
            color: '#fff' //Color del texto de los rangos
        }
    },

    //Se configura el mapa que va a utilizar, en este caso es el que se registro en ./js/maps/mexico.js
    geo: {
        map: 'mexmunicipios', //El nombre con el que se registro el mapa
        zoom: 0.5, //Zoom inicial al mapa
        // center: [-100.98561551896913, 23.205000490896193],
        label: {
            emphasis: {
                show: true //Este es para mostrar el título de la región sobre la que se pasa el cursor 
            }
        },
        roam: true, //Es para permitir que se pueda navegar o hacer zoom en el mapa
        itemStyle: {
            normal: {
                areaColor: '#323c48',
                borderColor: '#111' //Este es el color del borde de cada una de las regiones
            },
            emphasis: {
                areaColor: '#2a333d' //Este es para cambiar el color cuando se pasa el cursor encima de alguna región
            }
        }
    },
    series: [{
        name: 'AQI', //Nombre de la serie utilizado para mostrar información sobre herramientas, actualizar datos y configuración con setOption.
        type: 'heatmap', //Es el tipo de mapa que se va a mostrar, 
        coordinateSystem: 'geo', //El mapa de calor puede ser usado con dos tipos de sistemas de coordenadas; geográficas y rectangulares
        data: convertData([ //Se manda llamar la función convertData que es la que entrega la matriz de los datos que se van a usar en la serie
            { name: "Jesus Maria", value: 400 },
            { name: "Rancho Medio Kilo", value: 500 },
            { name: "Calvillo", value: 1000 }
        ])
    }]
};

Other comments [其他信息]

  1. Complete map. 01

  2. Mouse hover. 02

  3. Same name property. 03

  4. GeoJSON to write the map municipios.zip

GibranLara commented 6 years ago

When identified as a bug, is an alternative suggested at this time? Or estimated repair time?

Thank you.

Ovilia commented 6 years ago

Sorry, I couldn't give you an estimated repair time or alternative. You may try to fix it by yourself and make a pull request if you like. By the way, why do data have same name? Can you try different id for data?

stale[bot] commented 4 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.