Closed tlow92 closed 3 years ago
I think I'd prefer exposing setTooltipIndex. I'll try to implement it today or tomorrow!
It's implemented but I don't have time to update the docs right now. You can use it though, just put a ref on
Thanks, can confirm that it is working! Really useful!
I am having the similar problem, tried to set and receive the ref on Tooltip, Line and Chart component/s but unsuccessful, where do I put the ref and get the value of it?
just checked out the code, I am pretty sure I need to use it on Line component, not sure why it isn't working, it's a React Function component, doing something like, ` import React from 'react'; import { Chart, } from 'react-native-responsive-linechart';
function CustomChart () { const chartTooltipRef = React.useRef(null); return ( <Chart ... > <Line ref={chartTooltipRef} ... /> ) } `
Nevermind, turns out that I was using an older version of the library. My bad, should've checked before posting here.
Thanks :) Appreciate the hard work on this library.
Hi,
is it possible to access setTooltipIndex in order to be able to close the tooltip in some cases?
The reason is, that often times you have different time periods that you can choose from. I am changing the x and y domain using state variable but the tooltip stays open, if you change the domain.
So either I could use the setTooltipIndex or the library has to close the tooltip when domain prop is changed.
if you think it's not possible right now, but what change you prefer I could provide a PR with changes.