react-native-gifted-charts icon indicating copy to clipboard operation
react-native-gifted-charts copied to clipboard

Scroll the chart with fixed pointer in the middle

Open darkholiday opened this issue 2 years ago • 1 comments

Hello,

Is it possible to do this behavior using gifted-charts ??

The chart is scrollable and a pointer that is fixed in the middle of the chart shows the data that is pointed to it.

The chart start like this:

image

and when scrolling goes like this:

image

Please any tips! been trying libraries for 3 days and so far gifted charts is the best in term of UX

darkholiday avatar Sep 23 '22 13:09 darkholiday

Hello @Abhinandan-Kushwaha Can you please give me tips on how to do this behavior. I have integrate the library locally and start making changes to do this but its a little bit complicated for me.

darkholiday avatar Oct 12 '22 15:10 darkholiday

java.lang.Double cannot be cast to com.facebook.react.bridge.readableMap

imdipprokash avatar Oct 16 '22 19:10 imdipprokash

After 2 weeks of hard work i was able to do this behavior using your library I had to eliminate a lot of code to understand how it works. Just one thing still missing is making the height of pointer smooth cause now it only update on scroll and in the middle

pointerHeight = containerHeight - dataPointsHeight/4 - (currentValue * containerHeight) / maxValue)

I have the scroll offset that i can use to calculate a more precise height. its need someone smarter than me to figure out the equation. let me know if you need any help regarding this.

BTW the colors are dynamic i am using only one dataset

Here is a video

https://user-images.githubusercontent.com/10091953/196725309-fd40f910-354e-4c09-b488-0e865a8d703a.mp4

darkholiday avatar Oct 19 '22 14:10 darkholiday