Skip to content

Commit 64345a4

Browse files
author
Christoph Pader
committed
add README section for range
1 parent 0d4b228 commit 64345a4

1 file changed

Lines changed: 37 additions & 2 deletions

File tree

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ There are three events fired when the user interacts with the graph:
8282
2. `onPointSelected`: Fired for each point the user pans through. You can use this event to update labels or highlight selection in the graph.
8383
3. `onGestureEnd`: Fired once the user releases his finger and the pan gesture _deactivates_.
8484

85-
Pan gesture can be configures using these props:
85+
The pan gesture can be configured using these props:
8686

87-
1. `panGestureTimeout`: Set timeout for the pan gesture to activate. Set to `0` to start immediately after touch. Defaults to `300`.
87+
1. `panGestureDelay`: Set delay for the pan gesture to activate. Set to `0` to start immediately after touch. Defaults to `300`.
8888

8989
Example:
9090

@@ -124,6 +124,41 @@ Example:
124124
/>
125125
```
126126

127+
### `Range`
128+
129+
<img src="./img/range.png" align="right" height="150" />
130+
131+
Used to define a range for the graph canvas
132+
133+
This range has to be bigger than the span of the provided data points. This feature can be used, e.g. if the graph should show a fixed timeframe, whether there's data for that period or not.
134+
135+
<br />
136+
<br />
137+
138+
This example shows data in the timeframe between 01/01/2000 to 01/31/2000 and caps the value between 0 and 200:
139+
140+
```jsx
141+
<LineGraph
142+
points={priceHistory}
143+
animated={true}
144+
color="#4484B2"
145+
enablePanGesture={true}
146+
range={{
147+
x: {
148+
min: new Date(new Date(2000, 1, 1).getTime()),
149+
max: new Date(
150+
new Date(2000, 1, 1).getTime() +
151+
31 * 1000 * 60 * 60 * 24
152+
)
153+
},
154+
y: {
155+
min: 0,
156+
max: 200
157+
}
158+
}}
159+
/>
160+
```
161+
127162
---
128163

129164
### `SelectionDot`

0 commit comments

Comments
 (0)