Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Tooltip Formatter - Map chart - data parameter is undefined.... #19890

Open
disizlapeste opened this issue May 3, 2024 · 1 comment
Open
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@disizlapeste
Copy link

Version

5.5.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=map-usa

Steps to Reproduce

1- i'm trying to display a map chart based on this example https://echarts.apache.org/examples/en/editor.html?c=map-usa

2- i created a valid GeoJSON file from this link https://geojson-maps.kyd.au/

3- my chart Options Object is related file in attachment mapOptions.js

4- The problem is very simple. for tooltip , i choosed formatter function because i want a customized tooltip. formatter function has "params" as parameter. but "params.data" return UNDEFINED.. i don t understand what is wrong in my mapOptions structure. can you help me to understand. if series data is not well structured??
mapOptions.txt

Current Behavior

params.data = undefined
error

Expected Behavior

i expected to have params.data = [{value: ..., flagStatus:..., code:....}, {value: ..., flagStatus:..., code:....}]

Environment

- OS: 
- Browser:
- Framework:

Any additional comments?

No response

@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels May 3, 2024
@echarts-bot echarts-bot bot changed the title Tooltip Formatter - Map chart - data parameter is undefined.... [Bug] [Bug] Tooltip Formatter - Map chart - data parameter is undefined.... May 3, 2024
@helgasoft
Copy link

helgasoft commented May 3, 2024

series-map.data supports two main attributes - name and value. See the official example you referenced.
Just by renaming each country's "data" attribute to "value", you'll get what you want in tooltip formatter Demo.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

2 participants