coinjar / react-native-wagmi-charts

A sweet & simple chart library for React Native that will make us feel like We're All Gonna Make It.
MIT License
588 stars 116 forks source link

Partial Trading Day #5

Closed nandorojo closed 3 years ago

nandorojo commented 3 years ago

It could be cool to offer a partial trading day feature like Robinhood. Any thoughts on how this would be implemented? Presumably it could be as simple as changing the width prop, but might help to have some guidance on the right way to do it.

nandorojo commented 3 years ago

I think this could work if we add an xRange prop, similar to yRange.

The only difference is that, with xRange, we would have to monotonically increase the range from [0, max]. With yRange, your min and max are based on the value in each datapoint.

For xRange, on the other hand, you can probably only set max, and it has to be the max index, not the max timestamp. That is, unless add an xAxisDistributionStrategy prop, as mentioned at https://github.com/coinjar/react-native-wagmi-charts/pull/21#discussion_r739821448.

If we added that prop, then you could set the min and max based on actual timestamp values. But I don't see this being a common need, so we can probably just discard that.

nandorojo commented 3 years ago

Opened PR to add xLength at #33 to close this. Works for me.