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] Chart affected by other chart options #19880

Open
brandonstubbs opened this issue Apr 30, 2024 · 4 comments
Open

[Bug] Chart affected by other chart options #19880

brandonstubbs opened this issue Apr 30, 2024 · 4 comments
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@brandonstubbs
Copy link

Version

5.5.0

Link to Minimal Reproduction

https://gist.github.com/brandonstubbs/d1fe4a7d55495a59c3b7d86929f2085b

Steps to Reproduce

The gist is a full reproduction of the issue.

Current Behavior

The decal on the area chart is not on the correct series:
image

Expected Behavior

If you comment out the decal or you change the order that you set the options on the charts the decal will be correct:
image

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 Apr 30, 2024
@helgasoft
Copy link

Even if the observation is correct, scatter.itemStyle API has no decal, so setting it up does not make sense, no?

@brandonstubbs
Copy link
Author

brandonstubbs commented Apr 30, 2024

@helgasoft correct it doesn't make much sense having the decal there, however, I've noticed other strange behaviour with multiple charts and this was a mistake that took a long time to isolate, find and reproduce (Especially as it only happens if the scatter chart is rendered first)

Do you think a misconfigured option (or any option for that matter) should change the behaviour of another chart?

What do you think about the behaviour of this example?

@helgasoft
Copy link

Do you think a misconfigured option (or any option for that matter) should change the behaviour of another chart?

Of course not. And you are right, it is a bug 😓
In second example chart#1 sets only one general decal for all series, and chart#2 sets specific decals for each series (see Object vs array in docs).
Problem is that the 'general' takes precedence over the specific for the entire webpage - erroneously.
Fixed when chart#1 decals are defined specifically for each series:

           decals: [
             { symbol: "circle" },  // won't do much for scatter, but would show for bar
             { symbol: "none"   },
             { symbol: "none"   },
             { symbol: "square" },
           ],

And yes, scatter series is counted despite not being able to use decals.

@brandonstubbs
Copy link
Author

brandonstubbs commented May 1, 2024

In the second example it sets one decal for the series that should be repeated, as it's within the array as mentioned in the docs you linked.

See example of same decal repeated for each series.
See example of toggling between two decals for all the series.

So I think the example I had in the gist or even a toggle pattern example is a correct example. I want decals to toggle for all series. The above fix is not a repeating pattern of decals.

But I think we are starting to move away from the main issue: A charts options (and perhaps rendering order) is affecting another chart

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