Skip to content
Source
Sign inSign up
TanStack/react-charts

Tooltip issue #341

Send to my agent
Closedaevi1103(GitHub profile, opens in a new tab) opened this issue 8 comments

Tooltip is not anchored to the chart plot

image

https://codesandbox.io/s/react-charts-sample-9lodo4?file=/src/App.tsx

I forked the demo project, this onw works.

any idea why its not working on a new project?

https://codesandbox.io/s/elastic-ritchie-y4j9ml

image

  1. Any updates on this? I have the same issue.

  2. @mbogdan0 npm i @3.0.0-beta.30 seems to fix the issue.

  3. Experiencing this on react-charts@3.0.0-beta.54 version as well on line graphs and it looks like the example is also having this problem only on line graphs and not on the bars Screencast from 10-04-23 17:02:49.webm

  4. The problem seems to be with radius of circle on focused element. Occasionally tooltip is in correct position but usual bounding rect size is 0. The reason is that radius of focused element seems to be 0. It is set in this line

    https://github.com/TanStack/react-charts/blob/de262a7a00efcbd77c49952a45eaf0584af4a5c7/src/seriesTypes/Line.tsx#L105

    My guess is that focusedDatum is not always in sync and causes the problem. Not sure how to fix it though

  5. If focused datum check is removed from radius calculation tooltip will be shown correctly: const radius = showDatumElements === 'onFocus' ? 4 : 2

    It shouldn't affect elsewhere because it is not shown because of next check

    const show = showDatumElements === 'onFocus' ? datum === focusedDatum : secondaryAxis.showDatumElements ?? secondaryAxis.elementType === 'bubble'

    But I can't say it for sure if there would be some side-effects to make a pull request with given "fix"

  6. This is fixed in the latest release of beta

  7. tannerlinsley closed this

  8. I am on 3.0.0-beta.55 and I still have this issue with linecharts.

    image
  9. same issue here, anyone knows how to disable the animation of the tooltip?

Sign in to join this conversation.