-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data onover / onout not reliably called when moving between different series with same x-value #2901
Comments
Hi @grantcox, thanks for the post. I'll re-check the scenario if there're points to improve on this. |
Fix onover/onout event call on same x axis bar shape. Ref naver#2901
Make the call only when there's no selected shape. Ref naver#2901
Make the call only when there's no selected shape. Ref #2901
Fix onover/onout event call on same x axis bar shape. Fix #2901
Make the call only when there's no selected shape. Ref #2901
## [3.6.1](3.6.0...3.6.1) (2022-10-21) ### Bug Fixes * **interaction:** Fix incorrect data.onover/out event call ([1389d85](1389d85)), closes [#2901](#2901) * **tooltip:** fix redundant onxxx callback calls ([85cdf36](85cdf36)), closes [#2901](#2901) * **type:** add missing svg.classname type definition ([72e5c84](72e5c84)), closes [#2893](#2893)
@grantcox, released the 3.6.2 with the fix. And one reminder, when If don't want redundant event firing at the point of crossing the boundary of shapes, set the sensitivity value to 0 as follows. bar: {
sensitivity: 0
}, |
## [3.6.1](3.6.0...3.6.1) (2022-10-21) ### Bug Fixes * **interaction:** Fix incorrect data.onover/out event call ([1389d85](1389d85)), closes [#2901](#2901) * **tooltip:** fix redundant onxxx callback calls ([85cdf36](85cdf36)), closes [#2901](#2901) * **type:** add missing svg.classname type definition ([72e5c84](72e5c84)), closes [#2893](#2893)
Thank you @netil , both for the changes to |
Description
I want to show some information based on which datapoint is currently highlighted - much like a tooltip. This additional data involves template rendering so is a little expensive to generate, so I'd like to update it only when the highlighted data point actually changes.
Using
![data-onover](https://user-images.githubusercontent.com/186808/195143356-b00d07ce-5775-43cd-a60b-0c3063367420.gif)
data.onover
,data.onout
andtooltip.grouped = false
almost achieves what I want, the only problem is that theonout
for a series is only called when highlighting a completely separate x-axis value, not when highlighting another series value at the same x-axis value. This means that trying to compare two series at the same point in time works "one way" (as eachonover
is called in turn), but then stops updating.I can get the desired behavior to work by using the
![tooltip-onshow](https://user-images.githubusercontent.com/186808/195141856-15a34c77-d367-4f19-9681-5b90fbf2c0d1.gif)
tooltip.onshow
andtooltip.onhide
, but both of these callbacks are executed for every mouse movement even when there has been no significant change - there's no definitive "tooltip is no longer being shown" callback (afaict). To avoid expensive template re-rendering I'd need to debounce these calls and see if there was a net change over time.Is this the intended behavior? The
setOverOut
implementation (and cache usage), looks like it was intended to calldata.onout
for each datapoint as soon as the cursor moves outside the shape bounds - potentially multiple points could be "over" concurrently, but once moving outside the shape bounds the respectiveonout
should run immediately, rather than "once all shapes are out".Steps to check or reproduce
Here is a JSFiddle demonstrating these two cases: https://jsfiddle.net/6m9ay5Lh/4/
The text was updated successfully, but these errors were encountered: