react-native-graph icon indicating copy to clipboard operation
react-native-graph copied to clipboard

How to use it?README is not clear

Open Pahkoo opened this issue 1 year ago • 6 comments

1.usePriceHistory() Where does it come from? 2.LineGraph component ’point‘ property supports incoming data types 3.What specific features are available for the LineGraph component in total?

Pahkoo avatar Jul 05 '24 06:07 Pahkoo

I'm stuck at the same, is usePriceHistory(args) provided by the library? someone please clarify. If not how's this hook structured to return valid points prop?

naftalimurgor avatar Jul 25 '24 15:07 naftalimurgor

usePriceHistory() is a custom hook just used as an example, which would return GraphPoint[]

camchis avatar Jul 30 '24 15:07 camchis

points: GraphPoint[];

export interface GraphPoint {
    value: number;
    date: Date;
}

example: points = [{"date": 2024-08-28T19:00:00.000Z, "value": 897.2629999999999}, {"date": 2024-08-29T19:00:00.000Z, "value": 896.959}, {"date": 2024-08-30T19:00:00.000Z, "value": 891.172}, {"date": 2024-09-02T19:00:00.000Z, "value": 880.2819999999999}, {"date": 2024-09-03T19:00:00.000Z, "value": 863.4789999999999}, {"date": 2024-09-04T19:00:00.000Z, "value": 862.935}, {"date": 2024-09-05T19:00:00.000Z, "value": 868.665}, {"date": 2024-09-06T19:00:00.000Z, "value": 874.389}]

seelentov avatar Sep 07 '24 10:09 seelentov

Fair point, How about using custom labels like days of the week instead of Date?

naftalimurgor avatar Sep 26 '24 18:09 naftalimurgor

Fair point, How about using custom labels like days of the week instead of Date?

I think its get more functionality to module. Nothing prevents you from making the dates flat and configuring their output in the component configuration

seelentov avatar Sep 26 '24 18:09 seelentov

its still not remotely clear how to use this, the read me page basically gives you linegraph points={data} can how do I use strings vs values for example or xy plots ?

OisinSlevin avatar Feb 18 '25 21:02 OisinSlevin