Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

precision 0 does not work. #70

Open
nyan-left opened this issue Jan 31, 2022 · 3 comments
Open

precision 0 does not work. #70

nyan-left opened this issue Jan 31, 2022 · 3 comments

Comments

@nyan-left
Copy link
Contributor

Using:

 <LineChart.PriceText  precision={0} />

Current Output:

123.00

Expected Output:

123

The same applies to precision 1.

I'm aware that there's a format prop, but that also seems buggy. Will create a separate issue once I can reproduce it consistently.

@theartificialguy
Copy link

Hi, I'm here regarding a different issue, are you able to zoom-in in candlestick chart, if so, how can we do it? for example, if we have large data list, it populates all the candles across the whole width of screen i.e. it doesn't create a scroll effect nor it zooms-in. Are there any props that I'm not aware of? Please if you have something on this issue!

@nyan-left
Copy link
Contributor Author

nyan-left commented Jan 31, 2022

Hey @Yash-007 ,

I would suggest opening a seperate issue for this.

I think to achieve this, you would have to manually work out a way to pass the updated data props in. Most examples I've discovered so far simply use buttons at the bottom of the chart to load different data sets. For example:
Hourly, Daily, Weekly...etc.

You could in theory write some logic for zooming using gestures. Some things to think about:

  • You need a way to capture a ( presumably two-pointer) zoom gesture.
  • Then work out which index of your data set the pointers cover. For example: if you had 100 data points from 1 to 100, and a user places the first finger at x: 40% and the other at 70%, you would know to update your data prop to a dataset ranging from index 40 to index 70 of your original dataset.

Zooming out could work in a similar way.

You'll likely run into this issue #20 , so have a look into updating the yRange too.

Not sure if this is the best approach, but it seems feasible :)

@theartificialguy
Copy link

Hey @Yash-007 ,

I would suggest opening a seperate issue for this.

I think to achieve this, you would have to manually work out a way to pass the updated data props in. Most examples I've discovered so far simply use buttons at the bottom of the chart to load different data sets. For example: Hourly, Daily, Weekly...etc.

You could in theory write some logic for zooming using gestures. Some things to think about:

  • You need a way to capture a ( presumably two-pointer) zoom gesture.
  • Then work out which index of your data set the pointers cover. For example: if you had 100 data points from 1 to 100, and a user places the first finger at x: 40% and the other at 70%, you would know to update your data prop to a dataset ranging from index 40 to index 70 of your original dataset.

Zooming out could work in a similar way.

You'll likely run into this issue #20 , so have a look into updating the yRange too.

Not sure if this is the best approach, but it seems feasible :)

Hi, I tried to use PanGestureHandler and PinchGestureHandler inside a same view but only one appears to work at same time. Could please take a look, here is the project (just 3-4 files), I'm trying to implement candlestick chart using react-native-gesture-handler and react-native-reanimted.

https://github.com/theartificialguy/rn-candlestick-chart/tree/master

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants