You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "MrSulm (via GitHub)" <gi...@apache.org> on 2023/06/28 05:49:09 UTC

[GitHub] [echarts] MrSulm opened a new issue, #18816: [Bug] 两张相似的echart表connect相连,且每个echart都设置了toolbox.feature.magicType.type为['line', 'bar'],切换其中一个echart后,另一个echart的数据渲染错误。

MrSulm opened a new issue, #18816:
URL: https://github.com/apache/echarts/issues/18816

   ### 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的数据
   ![image](https://github.com/apache/echarts/assets/13568441/d8b79976-3bb1-4695-b835-ee2065a040fb)
   ![image](https://github.com/apache/echarts/assets/13568441/a58fc939-eea8-4a22-8c01-abc869d515dc)
   
   
   ### Current Behavior
   
   connect的echart图表渲染了所有echart的数据
   
   ### Expected Behavior
   
   仅渲染自己的数据
   
   ### Environment
   
   ```markdown
   - OS:
   - Browser:
   - Framework:
   ```
   
   
   ### Any additional comments?
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on issue #18816: [Bug] 两张相似的echart表connect相连,且每个echart都设置了toolbox.feature.magicType.type为['line', 'bar'],切换其中一个echart后,另一个echart的数据渲染错误。

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on issue #18816:
URL: https://github.com/apache/echarts/issues/18816#issuecomment-1610783096

   @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. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **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
   
   1. Create two echart charts, and set the toolbox.feature.magicType.type of the two charts to ['line', 'bar']
   2. Connect two echart charts, echarts.connect([echart1, echart2])
   3. Switch the rendering mode of one of the echarts, and the data of the other echart will merge the data of all connected echarts
   ![image](https://github.com/apache/echarts/assets/13568441/d8b79976-3bb1-4695-b835-ee2065a040fb)
   ![image](https://github.com/apache/echarts/assets/13568441/a58fc939-eea8-4a22-8c01-abc869d515dc)
   
   
   ### Current Behavior
   
   connect's echart chart renders all echart data
   
   ### Expected Behavior
   
   Only render own data
   
   ### Environment
   
   ```markdown
   - OS:
   -Browser:
   - Framework:
   ```
   
   
   ### Any additional comments?
   
   _No response_
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] linghaoSu commented on issue #18816: [Bug] 两张相似的echart表connect相连,且每个echart都设置了toolbox.feature.magicType.type为['line', 'bar'],切换其中一个echart后,另一个echart的数据渲染错误。

Posted by "linghaoSu (via GitHub)" <gi...@apache.org>.
linghaoSu commented on issue #18816:
URL: https://github.com/apache/echarts/issues/18816#issuecomment-1622106135

   `echarts.connect` broadcast chart's action in other charts, and make some action (like tooltip) behavior synced. 
   
   <img width="617" alt="image" src="https://github.com/apache/echarts/assets/56526981/f74cb927-b8c2-4de1-9f52-8eda6f87759f">
   
   But for the `magicType` action(this action makes `bar` to `line`, or reverse), this action creates a new series option based on current series data and put them in action payload.
   
   <img width="594" alt="image" src="https://github.com/apache/echarts/assets/56526981/a8844f1d-fa4b-4f5d-a77a-6cbaf88387f4">
   
   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.
   
   <img width="396" alt="image" src="https://github.com/apache/echarts/assets/56526981/43ca9ddd-c9c6-4d3c-86d3-0d8d11c49a25">
   
   @Ovilia Hi, maybe the logic for generating a new series in `magicType` needs to be moved to the front of `mergeOptions`, rather than in `onClick`?
   This way, when the action is triggered by another connected chart, the corresponding synchronized action can happen without errors.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org