What problem does this feature solve?
工作中遇到一个需求在页面上显示两个热力图:首先要满足当一个图表中点击之后,另一个图表中对应的元素需要高亮,其次是满足两个热力图相对应的visualMap也能根据选中的元素更新选中状态。
已经尝试过使用connect以及监听hover通过dispactch改变高亮状态,但这两个方法结合使用只能改变热力图中方块的状态,而无法更改visualMap的状态
查阅相关文档后发现visualMap只提供selectDataRange相关的action接口,这个只能改变范围,无法更改选中状态。
查阅源码后发现visualMap是通过监听mousehover事件来更新选中状态的,所以我无法通过更改第二个表的highLight高亮状态使其更新状态
我想这是一个需求比较高的接口,可以大大的提高echarts的交互性。
What does the proposed API look like?
- 也许可以给visualMap添加类似
selectData
之类的action接口:可以通过mousehover选中的数据来更新visualMap选中状态 - 或者给visualMap添加一个option或者判断规则:可以通过监听高亮状态的热力图块来更新状态
- 或者在connect方法中添加visualMap的联动效果
2条答案
按热度按时间3mpgtkmj1#
@N1body 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
[Feature] Can visualMap provide selectData interface?
BODY
What proplem does this feature solver?
When you encounter a need to display two thermal maps on the page: First of all, when you click on one chart, the corresponding elements in another chart need to be highlighted. Selected element update selection status.
I have tried to use Connect and monitor Hover to change the high bright state through Dispactch, but these two methods can only change the state of the Chinese block in the combination of the heat map, and cannot change the state of VisualMap's state
After consulting the relevant documentation, it was found that VisualMap only provided SelectData Manage event interface. This can only change the range and cannot change the selection state. After checking the source code, I found that VisualMap updates the selected state by monitoring the MouseHover event, so I cannot update the state by changing the highlight state of the second table.
I think this is an interface with a high demand, which can greatly improve the interaction of ECharts.
What does the proposed api look like?
Maybe you can add interfaces such as
selectdata
to VisualMap: you can update the VisualMap selected status through the data selected by MouseHover. Or add an Option or judgment rule to VisualMap: you can update the status by listening to the high -brightness of the highlight stateoipij1gg2#
If this is about added selection to visualmap, then 👍