echarts [Bug] Chart affected by other chart options

7z5jn7bk  于 4个月前  发布在  Echarts
关注(0)|答案(4)|浏览(39)

Version

5.5.0

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:

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:

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

h4cxqtbf

h4cxqtbf1#

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

qnakjoqk

qnakjoqk2#

@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?

oknwwptz

oknwwptz3#

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.

kpbpu008

kpbpu0084#

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

相关问题