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] Multiple map series and visualMap objects not mapping as expected #20587

Open
amandamcvey opened this issue Dec 13, 2024 · 10 comments
Open
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@amandamcvey
Copy link

amandamcvey commented Dec 13, 2024

Version

5.5.1

Link to Minimal Reproduction

https://codepen.io/amcveyCW/pen/OPLbpbd

Steps to Reproduce

  1. Add at least two series objects. Each should be of type 'map,' reference some map SVG, and include their own data array relating to the referenced map.
  2. Create a matching number of visualMap objects, either 'piecewise' or 'continuous' type. Set up some unique min/max/color/etc for each object. Each should include seriesIndex and the value should reference one of the corresponding series object created in the above step.
  3. Include legend for testing purposes.
  4. Note that the first visualMap object's seriesIndex is not respected and it controls both map series. By comparison, the following visualMap objects behave correctly and their seriesIndex is respected. This is visible when the first map (A) is deselected from the legend.

Current Behavior

The first visualMap object thresholds and colors are applied to all series objects. If type 'continuous' - the following series objects are mapped to the first visualMap's 'max' color. If type 'piecewise' - the following series objects are mapped to the first visualMap object's 'outofrange' color.

Expected Behavior

Each series object to map to its corresponding visualMap object when referenced using the related seriesIndex and depict the threshold colors of that visualMap object.

Environment

No response

Any additional comments?

Both continuous and piecewise examples:
https://codepen.io/amcveyCW/pen/OPLbpbd
https://codepen.io/amcveyCW/pen/QwLGpdL

NOTE: One visualMap is not sufficient in my case where I have two separate regions that map to two different metrics. Imagine an image of a radiator and a fan - the radiator is mapped to a temperature value while the fan is mapped to a speed value.

NOTE: Using geo and geoIndex is an alternative that does not cause superimposed maps. https://codepen.io/amcveyCW/pen/MYgJxaV

@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 Dec 13, 2024
@helgasoft
Copy link

Why have two identical maps superimposed ? Usually one map is sufficient - Demo.

@amandamcvey
Copy link
Author

@helgasoft Hi! Unfortunately one visualMap is not sufficient in my case. I have two separate regions that map to two different data points. Imagine an image of a radiator and a fan - the radiator is mapped to a temperature value while the fan is mapped to a speed value. Can't use the same visualMap in this case

@amandamcvey
Copy link
Author

@Adarsh-Dhar Hi! unfortunately your example does not work as expected if both series are mapped to the second visualMap object. This can be confirmed by using the slider of the second visualMap.

@helgasoft
Copy link

I seriously doubt ECharts allows more than a single map on a chart. Simple experiment is to set a different center on each map.
And with a single series there couldn't be more than a single visualMap.

@amandamcvey
Copy link
Author

amandamcvey commented Dec 17, 2024

@helgasoft i wrote this issue to only include the bare minimum amount of code needed to show the bug per the bug report requirements, but if the superimposed map is an issue - using geo and geoIndex is an alternative that does not cause multiple map figures. I will create and post an example

@amandamcvey
Copy link
Author

@helgasoft here is an example using geo https://codepen.io/amcveyCW/pen/MYgJxaV

@helgasoft
Copy link

I think your last example is a good illustration of the bug. There are two map series defined, but their data is auto-merged into one (=bug!). The first visualMap controls it. The second visualMap controls nothing since there is no second map.
Documentation should be updated to say "Only one map series allowed without geo defined. And each geo area is limited to only one map series".

OTOH, using geo is a good idea - geo acts like grid and we can have multiple geo areas superimposed - Demo.
Unfortunately roam will not work correctly, which makes the map static.
image

@amandamcvey
Copy link
Author

amandamcvey commented Dec 17, 2024

@helgasoft Your multiple geo solution should work for me, luckily I do not currently need roam. Thank you!
Regardless of echart's intention, why is the 'auto-merge into one' not the case for my first two examples, ie. the examples that do not use geo? Or rather is it that they were not good examples of the bug?

@helgasoft
Copy link

@amandamcvey, thank you for not giving up :-)
My assumption of "auto-merge" was wrong. By adding legend:{} to your initial examples it becomes obvious that multiple maps are indeed created, data is not "merged". I was fooled by the final chart behavior.

Now I think the bug is in seriesIndex of the first visualMap. Parameter seriesIndex:0 is not respected and the first visualMap controls both map series. By comparison, the second visualMap behaves correctly and seriesIndex:1 is respected. Visible when the first map (A) is deselected from the legend.

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

3 participants