echarts [Bug] Piecewise visualMap pieces are reset when setOption()

8wtpewkr  于 4个月前  发布在  Echarts
关注(0)|答案(2)|浏览(80)

Version

5.3.3

https://codepen.io/tigemi/pen/rNramOL

Steps to Reproduce

  1. Toggle some pieces of the visual map into inactive

  1. Click on the Set option button to invoke chart.setOption({})
  2. Notice the visual map pieces

Current Behavior

The state of visual map pieces is reset, and the previous state is not preserved

Expected Behavior

The state of pieces that have been toggled into inactive should be kept ( inactive )

Environment

- OS: Windows 10
- Browser: Chrome 108.0.5359.125

Any additional comments?

Maybe this issue relates to #8655

fdx2calv

fdx2calv1#

Yes, visualMap is reset. But there is a workaround:
If you want to keep the visualMap selection on setOption, you could keep track of it and dispatch it back after setOption.
Demo Code - double-click on bars to do setOption

c9qzyr3d

c9qzyr3d2#

Thanks @helgasoft for the workaround, but that is actually an issue that needs to be fixed.

相关问题