Open simyxing opened 1 month ago
Hi @simyxing Can you check again in the latest version of react-native-gifted-charts?
@Abhinandan-Kushwaha Yes, the issue is persist in the latest version of react-native-gifted-charts (1.4.43)
I am using the latest version of react native gifted charts.
I have found out upon releasing the pointer on a bar chart, BarChart
, the pointer index is correctly set to -1
.
However, on a line chart, LineChart
, upon releasing the pointer the same last point index erroneously persists.
I will look at the source code. If am able to fix that I will create a fix branch and submit a merge request.
react-native-gifted-charts is one of the best chart library I have found for react-native.
Thanks!
Hi @simyxing Can you check again in the latest version of react-native-gifted-charts?
Would you make it possible to create a fixed branch straight from an issue as mentioned?
To see what I mean, you can check this YouTube video
@Abhinandan-Kushwaha Yes, the issue is persist in the latest version of react-native-gifted-charts (1.4.43)
@Abhinandan-Kushwaha, @simyxing
https://github.com/Abhinandan-Kushwaha/react-native-gifted-charts/issues/854
The lines of code that reset the line chart pointer index to -1
upon releasing it were commented on. I have uncommented them.
Now, the pointer index is correctly set to -1
when the pointer is released.
I am asking myself why these lines of code were commented on. Was it during testing or was this in conflict with another feature / behavior?
You can directly install the (npm package) branch with the fixes / removed comments from git using:
npx npm install git+https://github.com/jeanniton-mnr/react-native-gifted-charts.git
PS: I am submitting my PR in a few.
Best & happy coding!
Description
When using the
getPointerProps
function, the index updates correctly as the pointer moves across different points on the chart. However, upon releasing the pointer, the index reverts to the previously selected point instead of returning index -1.Expected Behavior
Upon releasing the pointer, getPointerProps should return index = -1 to signify no point is selected after release.
Actual Behavior:
On release, the index reverts to the previously selected point, rather than returning -1.
Workaround:
Temporarily, I am just using
pointerX = 0
to identify if it is released.Additional Information:
Steps to reproduce
Snack or a link to a repository
No response
version of react-native-gifted-charts
1.4.34
React Native version
0.75.2
Platforms
Android, iOS
Workflow
React Native