[xychart] Tooltip does not update when chart position changes
See original GitHub issuehttps://user-images.githubusercontent.com/1286001/103257155-2f4eda00-49e4-11eb-8eb9-0d98c701b96e.mov
This behaviour happens when using visx in the react-grid-layout
library. When the chart is moved, the x and y positions are not updated and the tooltip is displayed where the chart used to be. After a resize, the since the width prop has changed, the tooltip is rendered correctly.
I can work around this by passing the chart’s X and Y position in as a prop, but I feel like this may be something that the library can solve automatically for me. Thoughts?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (2 by maintainers)
Top Results From Across the Web
[xychart] Tooltip does not update when chart position changes
This behaviour happens when using visx in the react-grid-layout library. When the chart is moved, the x and y positions are not updated...
Read more >visx/xychart documentation - Airbnb Engineering & Data Science
Series and XYChart events, including tooltip updates, are emitted and handled with through this context.
Read more >amCharts tooltip is showing only on DateAxis but not ValueAxis
I'm using amCharts and I'm making a XY Chart with multiple series, the tooltip shows ony when ...
Read more >GaugeChart – amCharts 4 Documentation
Indicates if chart should arrange series tooltips so that they would not overlap. If set to true (default), the chart will adjust vertical...
Read more >Perspective - XY Chart - Ignition User Manual 8.1
Objects that are the data source for the chart. When configured to show a date or time on the x-axis, the chart expects...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@RIP21 great suggestion re discussions, it wasn’t available for a while but looks like it is now. Just enabled it, so discuss away! 😎
Ah this is an interesting limitation. The
XYChart
tooltip is rendered inside of aReact
Portal and so is absolutely positioned on the page. This was intentional and can be very useful in various circumstances so that it’s not clipped by any parent DOM elements of the chart (see z-index stacking context for more).It’s implemented with
react-use-measure
such that it will correct its position upon page scroll, but not if the parent element moves. I’d have to think about robust ways to detect this (open to ideas!), for now I’d suggest @VigneshTrantor 's workaround for force updating with akey
change if you know the change happens.