Open ismailonur opened 1 year ago
Same here.
Agreed. Show imports and possibly a better use case
Unsure how to use priceHistory too. Very unclear in the docs.
Hey @Montchy can I pick this up?
I found some examples here: https://github.com/margelo/react-native-graph/blob/main/example/src/data/GraphData.ts
function weightedRandom(mean: number, variance: number): number {
var distribution = gaussian(mean, variance)
// Take a random sample using inverse transform sampling method.
return distribution.ppf(Math.random())
}
export function generateRandomGraphData(length: number): GraphPoint[] {
return Array<number>(length)
.fill(0)
.map((_, index) => ({
date: new Date(
new Date(2000, 0, 1).getTime() + 1000 * 60 * 60 * 24 * index
),
value: weightedRandom(10, Math.pow(index + 1, 2)),
}))
}
export function generateSinusGraphData(length: number): GraphPoint[] {
return Array<number>(length)
.fill(0)
.map((_, index) => ({
date: new Date(index),
value: Math.sin(index),
}))
}
1-) Where does usePriceHistory come from? 2-) Is priceHistory an array or an object? What value should it contain? Thank you