Version
5.2.4
Link to Minimal Reproduction
http://1.andrewblack.sinaapp.com/chart/index.html
Steps to Reproduce
1、创建两个echart图表,且设置两张图表的toolbox.feature.magicType.type为['line', 'bar']
2、令两个echart图表connect相连,echarts.connect([echart1, echart2])
3、切换其中一个echart的渲染模式,另一个echart的数据就会合并所有相连的echart的数据
Current Behavior
connect的echart图表渲染了所有echart的数据
Expected Behavior
仅渲染自己的数据
Environment
- OS:
- Browser:
- Framework:
Any additional comments?
No response
2条答案
按热度按时间dm7nw8vv1#
@MrSulm It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
TRANSLATED
TITLE
[Bug] Two similar echart tables are connected by connect, and each echart has toolbox.feature.magicType.type set to ['line', 'bar']. After switching one of the echarts, the data rendering error of the other echart .
BODY
Version
5.2.4
Link to Minimal Reproduction
http://1.andrewblack.sinaapp.com/chart/index.html
Steps to Reproduce
Current Behavior
connect's echart chart renders all echart data
Expected Behavior
Only render own data
Environment
Any additional comments?
No response
hc2pp10m2#
echarts.connect
broadcast chart's action in other charts, and make some action (like tooltip) behavior synced.But for the
magicType
action(this action makesbar
toline
, or reverse), this action creates a new series option based on current series data and put them in action payload.So for these charts which connected, they just get a new series option, but they do not have that series in payload before, so they render the new series data in these connected charts.
@Ovilia Hi, maybe the logic for generating a new series in
magicType
needs to be moved to the front ofmergeOptions
, rather than inonClick
?This way, when the action is triggered by another connected chart, the corresponding synchronized action can happen without errors.