react-native-wagmi-charts 1.8.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/.DS_Store +0 -0
  2. package/README.md +331 -196
  3. package/example/.DS_Store +0 -0
  4. package/example/src/LineChart.tsx +10 -4
  5. package/example/src/data/line-data.json +20 -20
  6. package/lib/commonjs/charts/candle/utils/getDomain.js +19 -0
  7. package/lib/commonjs/charts/candle/utils/getDomain.js.map +1 -0
  8. package/lib/commonjs/charts/candle/utils/getHeight.js +19 -0
  9. package/lib/commonjs/charts/candle/utils/getHeight.js.map +1 -0
  10. package/lib/commonjs/charts/candle/utils/getPrice.js +20 -0
  11. package/lib/commonjs/charts/candle/utils/getPrice.js.map +1 -0
  12. package/lib/commonjs/charts/candle/utils/getY.js +19 -0
  13. package/lib/commonjs/charts/candle/utils/getY.js.map +1 -0
  14. package/lib/commonjs/charts/candle/utils/index.js +58 -0
  15. package/lib/commonjs/charts/candle/utils/index.js.map +1 -0
  16. package/lib/commonjs/charts/line/Chart.js +9 -3
  17. package/lib/commonjs/charts/line/Chart.js.map +1 -1
  18. package/lib/commonjs/charts/line/ChartPath.js +73 -17
  19. package/lib/commonjs/charts/line/ChartPath.js.map +1 -1
  20. package/lib/commonjs/charts/line/Context.js +1 -0
  21. package/lib/commonjs/charts/line/Context.js.map +1 -1
  22. package/lib/commonjs/charts/line/Cursor.js +1 -0
  23. package/lib/commonjs/charts/line/Cursor.js.map +1 -1
  24. package/lib/commonjs/charts/line/CursorCrosshair.js +10 -3
  25. package/lib/commonjs/charts/line/CursorCrosshair.js.map +1 -1
  26. package/lib/commonjs/charts/line/CursorLine.js +6 -6
  27. package/lib/commonjs/charts/line/CursorLine.js.map +1 -1
  28. package/lib/commonjs/charts/line/DatetimeText.js +2 -0
  29. package/lib/commonjs/charts/line/DatetimeText.js.map +1 -1
  30. package/lib/commonjs/charts/line/Dot.js +67 -62
  31. package/lib/commonjs/charts/line/Dot.js.map +1 -1
  32. package/lib/commonjs/charts/line/Gradient.js +8 -25
  33. package/lib/commonjs/charts/line/Gradient.js.map +1 -1
  34. package/lib/commonjs/charts/line/Group.js +5 -25
  35. package/lib/commonjs/charts/line/Group.js.map +1 -1
  36. package/lib/commonjs/charts/line/Highlight.js +92 -0
  37. package/lib/commonjs/charts/line/Highlight.js.map +1 -0
  38. package/lib/commonjs/charts/line/HorizontalLine.js +6 -6
  39. package/lib/commonjs/charts/line/HorizontalLine.js.map +1 -1
  40. package/lib/commonjs/charts/line/Path.js +19 -30
  41. package/lib/commonjs/charts/line/Path.js.map +1 -1
  42. package/lib/commonjs/charts/line/PriceText.js +2 -0
  43. package/lib/commonjs/charts/line/PriceText.js.map +1 -1
  44. package/lib/commonjs/charts/line/Tooltip.js +2 -0
  45. package/lib/commonjs/charts/line/Tooltip.js.map +1 -1
  46. package/lib/commonjs/charts/line/index.js +47 -20
  47. package/lib/commonjs/charts/line/index.js.map +1 -1
  48. package/lib/commonjs/charts/line/useAnimatedPath.js +44 -0
  49. package/lib/commonjs/charts/line/useAnimatedPath.js.map +1 -0
  50. package/lib/commonjs/charts/line/{utils.js → utils/getArea.js} +2 -49
  51. package/lib/commonjs/charts/line/utils/getArea.js.map +1 -0
  52. package/lib/commonjs/charts/line/utils/getDomain.js +16 -0
  53. package/lib/commonjs/charts/line/utils/getDomain.js.map +1 -0
  54. package/lib/commonjs/charts/line/utils/getPath.js +34 -0
  55. package/lib/commonjs/charts/line/utils/getPath.js.map +1 -0
  56. package/lib/commonjs/charts/line/utils/index.js +71 -0
  57. package/lib/commonjs/charts/line/utils/index.js.map +1 -0
  58. package/lib/commonjs/charts/line/{interpolatePath.js → utils/interpolatePath.js} +1 -1
  59. package/lib/commonjs/charts/line/{interpolatePath.js.map → utils/interpolatePath.js.map} +1 -1
  60. package/lib/commonjs/charts/line/utils/lineChartDataPropToArray.js +27 -0
  61. package/lib/commonjs/charts/line/utils/lineChartDataPropToArray.js.map +1 -0
  62. package/lib/commonjs/index.js +8 -8
  63. package/lib/commonjs/index.js.map +1 -1
  64. package/lib/commonjs/utils/formatDatetime.js +21 -0
  65. package/lib/commonjs/utils/formatDatetime.js.map +1 -0
  66. package/lib/commonjs/utils/formatPrice.js +46 -0
  67. package/lib/commonjs/utils/formatPrice.js.map +1 -0
  68. package/lib/commonjs/utils/index.js +45 -0
  69. package/lib/commonjs/utils/index.js.map +1 -0
  70. package/lib/commonjs/{utils.js → utils/usePrevious.js} +1 -57
  71. package/lib/commonjs/utils/usePrevious.js.map +1 -0
  72. package/lib/module/charts/candle/utils/getDomain.js +12 -0
  73. package/lib/module/charts/candle/utils/getDomain.js.map +1 -0
  74. package/lib/module/charts/candle/utils/getHeight.js +11 -0
  75. package/lib/module/charts/candle/utils/getHeight.js.map +1 -0
  76. package/lib/module/charts/candle/utils/getPrice.js +12 -0
  77. package/lib/module/charts/candle/utils/getPrice.js.map +1 -0
  78. package/lib/module/charts/candle/utils/getY.js +11 -0
  79. package/lib/module/charts/candle/utils/getY.js.map +1 -0
  80. package/lib/module/charts/candle/utils/index.js +5 -0
  81. package/lib/module/charts/candle/utils/index.js.map +1 -0
  82. package/lib/module/charts/line/Chart.js +9 -4
  83. package/lib/module/charts/line/Chart.js.map +1 -1
  84. package/lib/module/charts/line/ChartPath.js +69 -17
  85. package/lib/module/charts/line/ChartPath.js.map +1 -1
  86. package/lib/module/charts/line/Context.js +1 -0
  87. package/lib/module/charts/line/Context.js.map +1 -1
  88. package/lib/module/charts/line/Cursor.js +1 -0
  89. package/lib/module/charts/line/Cursor.js.map +1 -1
  90. package/lib/module/charts/line/CursorCrosshair.js +10 -4
  91. package/lib/module/charts/line/CursorCrosshair.js.map +1 -1
  92. package/lib/module/charts/line/CursorLine.js +4 -3
  93. package/lib/module/charts/line/CursorLine.js.map +1 -1
  94. package/lib/module/charts/line/DatetimeText.js +1 -0
  95. package/lib/module/charts/line/DatetimeText.js.map +1 -1
  96. package/lib/module/charts/line/Dot.js +66 -63
  97. package/lib/module/charts/line/Dot.js.map +1 -1
  98. package/lib/module/charts/line/Gradient.js +8 -24
  99. package/lib/module/charts/line/Gradient.js.map +1 -1
  100. package/lib/module/charts/line/Group.js +2 -24
  101. package/lib/module/charts/line/Group.js.map +1 -1
  102. package/lib/module/charts/line/Highlight.js +69 -0
  103. package/lib/module/charts/line/Highlight.js.map +1 -0
  104. package/lib/module/charts/line/HorizontalLine.js +4 -3
  105. package/lib/module/charts/line/HorizontalLine.js.map +1 -1
  106. package/lib/module/charts/line/Path.js +17 -29
  107. package/lib/module/charts/line/Path.js.map +1 -1
  108. package/lib/module/charts/line/PriceText.js +1 -0
  109. package/lib/module/charts/line/PriceText.js.map +1 -1
  110. package/lib/module/charts/line/Tooltip.js +1 -0
  111. package/lib/module/charts/line/Tooltip.js.map +1 -1
  112. package/lib/module/charts/line/index.js +12 -8
  113. package/lib/module/charts/line/index.js.map +1 -1
  114. package/lib/module/charts/line/useAnimatedPath.js +34 -0
  115. package/lib/module/charts/line/useAnimatedPath.js.map +1 -0
  116. package/lib/module/charts/line/utils/getArea.js +19 -0
  117. package/lib/module/charts/line/utils/getArea.js.map +1 -0
  118. package/lib/module/charts/line/utils/getDomain.js +9 -0
  119. package/lib/module/charts/line/utils/getDomain.js.map +1 -0
  120. package/lib/module/charts/line/utils/getPath.js +21 -0
  121. package/lib/module/charts/line/utils/getPath.js.map +1 -0
  122. package/lib/module/charts/line/utils/index.js +6 -0
  123. package/lib/module/charts/line/utils/index.js.map +1 -0
  124. package/lib/module/charts/line/{interpolatePath.js → utils/interpolatePath.js} +1 -1
  125. package/lib/module/charts/line/{interpolatePath.js.map → utils/interpolatePath.js.map} +1 -1
  126. package/lib/module/charts/line/utils/lineChartDataPropToArray.js +20 -0
  127. package/lib/module/charts/line/utils/lineChartDataPropToArray.js.map +1 -0
  128. package/lib/module/index.js +1 -1
  129. package/lib/module/index.js.map +1 -1
  130. package/lib/module/utils/formatDatetime.js +14 -0
  131. package/lib/module/utils/formatDatetime.js.map +1 -0
  132. package/lib/module/{utils.js → utils/formatPrice.js} +1 -29
  133. package/lib/module/utils/formatPrice.js.map +1 -0
  134. package/lib/module/utils/index.js +4 -0
  135. package/lib/module/utils/index.js.map +1 -0
  136. package/lib/module/utils/usePrevious.js +14 -0
  137. package/lib/module/utils/usePrevious.js.map +1 -0
  138. package/lib/typescript/src/charts/candle/utils/getDomain.d.ts +2 -0
  139. package/lib/typescript/src/charts/candle/utils/getHeight.d.ts +6 -0
  140. package/lib/typescript/src/charts/candle/utils/getPrice.d.ts +6 -0
  141. package/lib/typescript/src/charts/candle/utils/getY.d.ts +6 -0
  142. package/lib/typescript/src/charts/candle/utils/index.d.ts +4 -0
  143. package/lib/typescript/src/charts/line/Chart.d.ts +5 -1
  144. package/lib/typescript/src/charts/line/ChartPath.d.ts +10 -1
  145. package/lib/typescript/src/charts/line/Context.d.ts +3 -0
  146. package/lib/typescript/src/charts/line/Cursor.d.ts +3 -0
  147. package/lib/typescript/src/charts/line/CursorCrosshair.d.ts +4 -1
  148. package/lib/typescript/src/charts/line/CursorLine.d.ts +4 -1
  149. package/lib/typescript/src/charts/line/DatetimeText.d.ts +3 -0
  150. package/lib/typescript/src/charts/line/Dot.d.ts +10 -7
  151. package/lib/typescript/src/charts/line/Gradient.d.ts +3 -0
  152. package/lib/typescript/src/charts/line/Group.d.ts +1 -2
  153. package/lib/typescript/src/charts/line/Highlight.d.ts +15 -0
  154. package/lib/typescript/src/charts/line/HorizontalLine.d.ts +4 -1
  155. package/lib/typescript/src/charts/line/Path.d.ts +5 -1
  156. package/lib/typescript/src/charts/line/PriceText.d.ts +3 -0
  157. package/lib/typescript/src/charts/line/Tooltip.d.ts +3 -0
  158. package/lib/typescript/src/charts/line/index.d.ts +15 -25
  159. package/lib/typescript/src/charts/line/useAnimatedPath.d.ts +8 -0
  160. package/lib/typescript/src/charts/line/utils/getArea.d.ts +9 -0
  161. package/lib/typescript/src/charts/line/utils/getDomain.d.ts +2 -0
  162. package/lib/typescript/src/charts/line/utils/getPath.d.ts +11 -0
  163. package/lib/typescript/src/charts/line/utils/index.d.ts +5 -0
  164. package/lib/typescript/src/charts/line/{interpolatePath.d.ts → utils/interpolatePath.d.ts} +1 -1
  165. package/lib/typescript/src/charts/line/utils/lineChartDataPropToArray.d.ts +2 -0
  166. package/lib/typescript/src/index.d.ts +1 -1
  167. package/lib/typescript/src/utils/formatDatetime.d.ts +8 -0
  168. package/lib/typescript/src/utils/formatPrice.d.ts +8 -0
  169. package/lib/typescript/src/utils/index.d.ts +3 -0
  170. package/lib/typescript/src/utils/usePrevious.d.ts +1 -0
  171. package/package.json +4 -2
  172. package/src/charts/candle/utils/getDomain.ts +9 -0
  173. package/src/charts/candle/utils/getHeight.ts +21 -0
  174. package/src/charts/candle/utils/getPrice.ts +17 -0
  175. package/src/charts/candle/utils/getY.ts +16 -0
  176. package/src/charts/candle/utils/index.ts +4 -0
  177. package/src/charts/line/Chart.tsx +9 -3
  178. package/src/charts/line/ChartPath.tsx +109 -33
  179. package/src/charts/line/Context.tsx +2 -0
  180. package/src/charts/line/Cursor.tsx +2 -0
  181. package/src/charts/line/CursorCrosshair.tsx +20 -5
  182. package/src/charts/line/CursorLine.tsx +5 -3
  183. package/src/charts/line/DatetimeText.tsx +2 -0
  184. package/src/charts/line/Dot.tsx +83 -86
  185. package/src/charts/line/Gradient.tsx +7 -34
  186. package/src/charts/line/Group.tsx +4 -47
  187. package/src/charts/line/Highlight.tsx +78 -0
  188. package/src/charts/line/HorizontalLine.tsx +5 -3
  189. package/src/charts/line/Path.tsx +14 -38
  190. package/src/charts/line/PriceText.tsx +2 -0
  191. package/src/charts/line/Tooltip.tsx +2 -0
  192. package/src/charts/line/index.ts +11 -7
  193. package/src/charts/line/useAnimatedPath.ts +47 -0
  194. package/src/charts/line/utils/getArea.ts +38 -0
  195. package/src/charts/line/utils/getDomain.ts +7 -0
  196. package/src/charts/line/utils/getPath.ts +48 -0
  197. package/src/charts/line/utils/index.ts +5 -0
  198. package/src/charts/line/{interpolatePath.ts → utils/interpolatePath.ts} +1 -1
  199. package/src/charts/line/utils/lineChartDataPropToArray.ts +25 -0
  200. package/src/index.ts +1 -1
  201. package/src/utils/formatDatetime.ts +16 -0
  202. package/src/{utils.ts → utils/formatPrice.ts} +0 -31
  203. package/src/utils/index.ts +3 -0
  204. package/src/utils/usePrevious.ts +13 -0
  205. package/yarn.lock +8 -1
  206. package/lib/commonjs/charts/line/utils.js.map +0 -1
  207. package/lib/commonjs/utils.js.map +0 -1
  208. package/lib/module/charts/line/utils.js +0 -60
  209. package/lib/module/charts/line/utils.js.map +0 -1
  210. package/lib/module/utils.js.map +0 -1
  211. package/lib/typescript/src/charts/line/utils.d.ts +0 -20
  212. package/lib/typescript/src/utils.d.ts +0 -17
  213. package/src/charts/line/utils.ts +0 -100
package/README.md CHANGED
@@ -31,23 +31,34 @@ A sweet & simple chart library for React Native that will make us feel like **W*
31
31
  - [Basic Usage](#basic-usage)
32
32
  - [Line chart](#line-chart)
33
33
  - [Candlestick chart](#candlestick-chart)
34
- - [Guides](#guides)
34
+ - [Line Chart Guides](#line-chart-guides)
35
35
  - [Interactive cursors](#interactive-cursors)
36
36
  - [Interactive labels](#interactive-labels)
37
37
  - [Interactive tooltips](#interactive-tooltips)
38
38
  - [Haptic feedback](#haptic-feedback)
39
39
  - [Colors](#colors)
40
40
  - [Gradients](#gradients)
41
+ - [Dots](#dots)
42
+ - [Horizontal lines](#horizontal-lines)
41
43
  - [Customizing size](#customizing-size)
42
44
  - [Customizing labels](#customizing-labels)
43
45
  - [Customizing tooltips](#customizing-tooltips)
46
+ - [Candlestick Chart Guides](#candlestick-chart-guides)
47
+ - [Interactive cursors](#interactive-cursors-1)
48
+ - [Interactive labels](#interactive-labels-1)
49
+ - [Interactive tooltips](#interactive-tooltips-1)
50
+ - [Haptic feedback](#haptic-feedback-1)
51
+ - [Colors](#colors-1)
52
+ - [Customizing labels](#customizing-labels-1)
44
53
  - [Component APIs](#component-apis)
45
54
  - [LineChart.Provider](#linechartprovider)
46
55
  - [LineChart](#linechart)
47
56
  - [LineChart.Path](#linechartpath)
48
57
  - [LineChart.CursorCrosshair](#linechartcursorcrosshair-1)
49
58
  - [LineChart.CursorLine](#linechartcursorline-1)
50
- - [LineChart.HorizontalLine](#linecharthorizontalline-1)
59
+ - [LineChart.Dot](#linechartdot)
60
+ - [LineChart.Highlight](#linechartdot)
61
+ - [LineChart.HorizontalLine](#linecharthorizontalline)
51
62
  - [LineChart.Gradient](#linechartgradient)
52
63
  - [LineChart.Tooltip](#linecharttooltip)
53
64
  - [LineChart.PriceText](#linechartpricetext)
@@ -55,7 +66,7 @@ A sweet & simple chart library for React Native that will make us feel like **W*
55
66
  - [CandlestickChart.Provider](#candlestickchartprovider)
56
67
  - [CandlestickChart](#candlestickchart)
57
68
  - [CandlestickChart.Candles](#candlestickchartcandles)
58
- - [CandlestickChart.Crosshair](#candlestickchartcrosshair-1)
69
+ - [CandlestickChart.Crosshair](#candlestickchartcrosshair)
59
70
  - [CandlestickChart.Tooltip](#candlestickcharttooltip)
60
71
  - [CandlestickChart.PriceText](#candlestickchartpricetext)
61
72
  - [CandlestickChart.DatetimeText](#candlestickchartdatetimetext)
@@ -67,9 +78,7 @@ A sweet & simple chart library for React Native that will make us feel like **W*
67
78
  - [CandlestickChart.useCandleData](#candlestickchartusecandledata)
68
79
  - [CandlestickChart.useDatetime](#candlestickchartusedatetime)
69
80
  - [CandlestickChart.usePrice](#candlestickchartuseprice)
70
- - [Web Support (Experimental)](#web-support)
71
- - [Disable Transitions](#disable-transitions)
72
- - [Reanimated Version](#reanimated-version)
81
+ - [Web Support](#web-support)
73
82
  - [Credits](#credits)
74
83
 
75
84
  ## Install
@@ -184,14 +193,12 @@ function Example() {
184
193
  }
185
194
  ```
186
195
 
187
- ## Guides
196
+ ## Line Chart Guides
188
197
 
189
- Below are some guides to help you make your charts suit your brand. Hopefully a combination of the below will enable you to make a great chart! :-)
198
+ Below are some line chart guides to help you make your charts suit your brand. Hopefully a combination of the below will enable you to make a great chart! :-)
190
199
 
191
200
  ### Interactive cursors
192
201
 
193
- #### Line chart
194
-
195
202
  To render an interactive cursor on your line chart, you can include either the `LineChart.CursorCrosshair` or `LineChart.CursorLine` components:
196
203
 
197
204
  ##### `LineChart.CursorCrosshair`
@@ -220,53 +227,8 @@ To render an interactive cursor on your line chart, you can include either the `
220
227
 
221
228
  <img src="https://user-images.githubusercontent.com/7336481/133027471-1c620ece-a95e-46b7-bd92-50f33757ce92.gif" width="200px" />
222
229
 
223
- ##### `LineChart.HorizontalLine`
224
-
225
- It's a static horizontal line which moves whenever your data change. It's located on height of point which is on `at` position of provided data.
226
-
227
- ```jsx
228
- <LineChart.Provider data={data}>
229
- <LineChart>
230
- <LineChart.Path>
231
- <LineChart.HorizontalLine at={{ index: 0 }} />
232
- </LineChart.Path>
233
- </LineChart>
234
- </LineChart.Provider>
235
- ```
236
-
237
- To pass a Y value to your `HorizontalLine` instead, you can use `value`:
238
-
239
- ```jsx
240
- <LineChart.Provider data={data}>
241
- <LineChart>
242
- <LineChart.Path>
243
- <LineChart.HorizontalLine at={{ value: 3027.84 }} />
244
- </LineChart.Path>
245
- </LineChart>
246
- </LineChart.Provider>
247
- ```
248
-
249
- #### Candlestick chart
250
-
251
- To render an interactive cursor on your candlestick chart, you can include the `CandlestickChart.Crosshair` component:
252
-
253
- ##### `CandlestickChart.Crosshair`
254
-
255
- ```jsx
256
- <CandlestickChart.Provider data={data}>
257
- <CandlestickChart>
258
- <CandlestickChart.Candles />
259
- <CandlestickChart.Crosshair />
260
- </CandlestickChart>
261
- </CandlestickChart.Provider>
262
- ```
263
-
264
- <img src="https://user-images.githubusercontent.com/7336481/133027656-a877b248-77c1-4bf3-822f-a05dee4efa20.gif" width="200px" />
265
-
266
230
  ### Interactive labels
267
231
 
268
- #### Line chart
269
-
270
232
  To render an interactive label on your line chart as your cursor moves along the graph, you can use the `PriceText` or `DatetimeText` components:
271
233
 
272
234
  > Note: These components **must** be within the `LineChart.Provider` component.
@@ -284,32 +246,8 @@ To render an interactive label on your line chart as your cursor moves along the
284
246
 
285
247
  <img src="https://user-images.githubusercontent.com/7336481/133028134-a0b65499-9edf-4535-9fcc-fcf8c1e4e0c4.gif" width="200px" />
286
248
 
287
- #### Candlestick chart
288
-
289
- To render an interactive label on your candlestick chart, you can use the `PriceText` or `DatetimeText` components:
290
-
291
- > Note: These components **must** be within the `CandlestickChart.Provider` component.
292
-
293
- ```jsx
294
- <CandlestickChart.Provider data={data}>
295
- <CandlestickChart>
296
- <CandlestickChart.Candles />
297
- <CandlestickChart.Crosshair />
298
- </CandlestickChart>
299
- <CandlestickChart.PriceText type="open" />
300
- <CandlestickChart.PriceText type="high" />
301
- <CandlestickChart.PriceText type="low" />
302
- <CandlestickChart.PriceText type="close" />
303
- <CandlestickChart.DatetimeText />
304
- </LineChart.Provider>
305
- ```
306
-
307
- <img src="https://user-images.githubusercontent.com/7336481/133034935-faea61e6-09c2-4dba-a1ab-555d1ebee880.gif" width="200px" />
308
-
309
249
  ### Interactive tooltips
310
250
 
311
- #### Line charts
312
-
313
251
  To render an interactive tooltip that follows your cursor, you can use the `Tooltip` component.
314
252
 
315
253
  ```jsx
@@ -343,29 +281,10 @@ You can even add another tooltip to show something like date/time:
343
281
 
344
282
  <img src="https://user-images.githubusercontent.com/7336481/133036011-8a9b4865-10dd-4e88-9fd1-1e109435a73c.gif" width="200px" />
345
283
 
346
- #### Candlestick charts
347
-
348
- To render an interactive tooltip that follows your crosshair, you can use the `Tooltip` component.
349
-
350
- ```jsx
351
- <CandlestickChart.Provider data={data}>
352
- <CandlestickChart>
353
- <CandlestickChart.Candles />
354
- <CandlestickChart.Crosshair>
355
- <CandlestickChart.Tooltip />
356
- </CandlestickChart.Crosshair>
357
- </CandlestickChart>
358
- </CandlestickChart.Provider>
359
- ```
360
-
361
- <img src="https://user-images.githubusercontent.com/7336481/133036451-e1f2f12b-9e96-4a0f-8c69-4f630bb8ded3.gif" width="200px" />
362
-
363
284
  ### Haptic feedback
364
285
 
365
286
  By making use of the chart event handlers, you are able to integrate haptic feedback into your charts.
366
287
 
367
- #### Line charts
368
-
369
288
  We can utilise the `onActivated` and `onEnded` events to create haptic feedback on our line chart.
370
289
 
371
290
  ```jsx
@@ -420,40 +339,11 @@ function Example() {
420
339
  }
421
340
  ```
422
341
 
423
- #### Candlestick charts
424
-
425
- We can utilise the `onCurrentXChange` event to create haptic feedback on our candlestick chart.
426
-
427
- ```jsx
428
- import * as haptics from 'expo-haptics';
429
-
430
- const data = [...];
431
-
432
- function invokeHaptic() {
433
- haptics.impactAsync(haptics.ImpactFeedbackStyle.Light);
434
- }
435
-
436
- function Example() {
437
- return (
438
- <CandlestickChart.Provider data={data}>
439
- <CandlestickChart>
440
- <CandlestickChart.Candles />
441
- <CandlestickChart.Crosshair onCurrentXChange={invokeHaptic}>
442
- <CandlestickChart.Tooltip />
443
- </CandlestickChart.Crosshair>
444
- </CandlestickChart>
445
- </CandlestickChart.Provider>
446
- )
447
- }
448
- ```
449
-
450
342
  ### Colors
451
343
 
452
344
  By default, the charts come with default colors out-of-the-box... But you probably will want to change these to suit your brand.
453
345
 
454
- #### Line charts
455
-
456
- ##### Coloring the path
346
+ #### Coloring the path
457
347
 
458
348
  To customise the color of the line chart path, supply a `color` prop to `LineChart.Path`. This can be any valid React Native `StyleSheet` compatible color.
459
349
 
@@ -467,7 +357,7 @@ To customise the color of the line chart path, supply a `color` prop to `LineCha
467
357
 
468
358
  <img src="https://user-images.githubusercontent.com/7336481/133037040-ce13ba5b-6ee5-45a2-ba14-18bf12e13746.png" width="200px" />
469
359
 
470
- ##### Coloring the cursor
360
+ #### Coloring the cursor
471
361
 
472
362
  To customise the color of the line chart cursor, supply a `color` prop to `LineChart.CursorCrosshair`. This can be any valid React Native `StyleSheet` compatible color.
473
363
 
@@ -484,66 +374,101 @@ To customise the color of the line chart cursor, supply a `color` prop to `LineC
484
374
 
485
375
  <img width="200px" alt="Screen Shot 2021-09-13 at 4 53 46 pm" src="https://user-images.githubusercontent.com/7336481/133037333-6b1345e5-a98b-459c-b3b1-6e5b08143f33.png">
486
376
 
487
- #### Candlestick charts
377
+ ### Gradients
488
378
 
489
- ##### Coloring the candles
379
+ By using the `LineChart.Gradient` component, you can apply a gradient to the area underneath your path.
490
380
 
491
- To customise the color of the candlestick chart candles, supply a `negativeColor` and a `positiveColor` to `CandlestickChart.Candles`. This can be any valid React Native `StyleSheet` compatible color.
381
+ ```jsx
382
+ <LineChart.Provider data={data}>
383
+ <LineChart>
384
+ <LineChart.Path color="red">
385
+ <LineChart.Gradient />
386
+ <LineChart.Path>
387
+ </LineChart>
388
+ </LineChart.Provider>
389
+ ```
390
+
391
+ <img width="346" alt="Screen Shot 2021-10-25 at 8 32 07 pm" src="https://user-images.githubusercontent.com/7336481/138672128-c691036e-404f-4148-8a3b-00ea2f7df27f.png">
392
+
393
+ The gradient will inherit your path's color by default, however, you can provide a color prop to `LineChart.Gradient`:
492
394
 
493
395
  ```jsx
494
- <CandlestickChart.Provider data={data}>
495
- <CandlestickChart>
496
- <CandlestickChart.Candles positiveColor="hotpink" negativeColor="black" />
497
- </CandlestickChart>
498
- </CandlestickChart.Provider>
396
+ <LineChart.Provider data={data}>
397
+ <LineChart>
398
+ <LineChart.Path color="red">
399
+ <LineChart.Gradient color="black" />
400
+ <LineChart.Path>
401
+ </LineChart>
402
+ </LineChart.Provider>
499
403
  ```
500
404
 
501
- <img width="200px" alt="Screen Shot 2021-09-13 at 4 58 52 pm" src="https://user-images.githubusercontent.com/7336481/133037949-aba76daa-20bb-4d4e-b05e-b0cff42b69a6.png">
405
+ <img width="345" alt="Screen Shot 2021-10-25 at 8 32 26 pm" src="https://user-images.githubusercontent.com/7336481/138672153-9ba11b02-b750-4ab0-a2e2-c18a9af4635f.png">
502
406
 
503
- ##### Coloring the crosshair
407
+ ### Dots
504
408
 
505
- To customise the color of the line chart cursor, supply a `color` prop to `CandlestickChart.Crosshair`. This can be any valid React Native `StyleSheet` compatible color.
409
+ You can render dots on your line chart with `LineChart.Dot`.
506
410
 
507
411
  ```jsx
508
- <CandlestickChart.Provider data={data}>
509
- <CandlestickChart>
510
- <CandlestickChart.Candles positiveColor="hotpink" negativeColor="black" />
511
- <CandlestickChart.Crosshair color="hotpink" />
512
- </CandlestickChart>
513
- </CandlestickChart.Provider>
412
+ <LineChart.Provider data={data}>
413
+ <LineChart>
414
+ <LineChart.Path>
415
+ <LineChart.Dot color="red" at={10} />
416
+ </LineChart.Path>
417
+ </LineChart>
418
+ </LineChart.Provider>
514
419
  ```
515
420
 
516
- <img width="200px" alt="Screen Shot 2021-09-13 at 4 58 52 pm" src="https://user-images.githubusercontent.com/7336481/133038181-33ee91bf-a5e2-4124-ab7b-df745a5ba804.gif">
421
+ Your dot can also have an animated pulse by passing the `hasPulse` prop.
517
422
 
518
- ### Gradients
423
+ ```jsx
424
+ <LineChart.Provider data={data}>
425
+ <LineChart>
426
+ <LineChart.Path>
427
+ <LineChart.Dot color="red" at={10} hasPulse />
428
+ </LineChart.Path>
429
+ </LineChart>
430
+ </LineChart.Provider>
431
+ ```
519
432
 
520
- By using the `LineChart.Gradient` component, you can apply a gradient to the area underneath your path.
433
+ ### Path highlighting
434
+
435
+ You can highlight a section of your path with `LineChart.Highlight`.
521
436
 
522
437
  ```jsx
523
438
  <LineChart.Provider data={data}>
524
439
  <LineChart>
525
- <LineChart.Path color="red">
526
- <LineChart.Gradient />
527
440
  <LineChart.Path>
441
+ <LineChart.Highlight color="red" from={10} to={15} />
442
+ </LineChart.Path>
528
443
  </LineChart>
529
444
  </LineChart.Provider>
530
445
  ```
531
446
 
532
- <img width="346" alt="Screen Shot 2021-10-25 at 8 32 07 pm" src="https://user-images.githubusercontent.com/7336481/138672128-c691036e-404f-4148-8a3b-00ea2f7df27f.png">
447
+ ### Horizontal lines
533
448
 
534
- The gradient will inherit your path's color by default, however, you can provide a color prop to `LineChart.Gradient`:
449
+ You can render a static horizontal line on your line chart which moves whenever your data change. It's located on height of point which is on `at` position of provided data.
535
450
 
536
451
  ```jsx
537
452
  <LineChart.Provider data={data}>
538
453
  <LineChart>
539
- <LineChart.Path color="red">
540
- <LineChart.Gradient color="black" />
541
454
  <LineChart.Path>
455
+ <LineChart.HorizontalLine at={{ index: 0 }} />
456
+ </LineChart.Path>
542
457
  </LineChart>
543
458
  </LineChart.Provider>
544
459
  ```
545
460
 
546
- <img width="345" alt="Screen Shot 2021-10-25 at 8 32 26 pm" src="https://user-images.githubusercontent.com/7336481/138672153-9ba11b02-b750-4ab0-a2e2-c18a9af4635f.png">
461
+ You can also pass a (y) value to `HorizontalLine` with the `value` attribute:
462
+
463
+ ```jsx
464
+ <LineChart.Provider data={data}>
465
+ <LineChart>
466
+ <LineChart.Path>
467
+ <LineChart.HorizontalLine at={{ value: 3027.84 }} />
468
+ </LineChart.Path>
469
+ </LineChart>
470
+ </LineChart.Provider>
471
+ ```
547
472
 
548
473
  ### Customizing size
549
474
 
@@ -567,7 +492,6 @@ By default, the price labels have a precision of `2`, meaning that the prices wi
567
492
 
568
493
  ```jsx
569
494
  <LineChart.PriceText precision={4} />
570
- <CandlestickChart.PriceText precision={4} />
571
495
  ```
572
496
 
573
497
  ##### Custom formatting
@@ -656,6 +580,188 @@ You can customize the gutters of the tooltip by providing `cursorGutter`, `xGutt
656
580
 
657
581
  <img src="https://user-images.githubusercontent.com/7336481/133054393-28d542c1-c9fc-4ba6-b4a0-86cf096ebcda.gif" width="200px" />
658
582
 
583
+ ## Candlestick Chart Guides
584
+
585
+ ### Interactive cursors
586
+
587
+ To render an interactive cursor on your candlestick chart, you can include the `CandlestickChart.Crosshair` component:
588
+
589
+ ```jsx
590
+ <CandlestickChart.Provider data={data}>
591
+ <CandlestickChart>
592
+ <CandlestickChart.Candles />
593
+ <CandlestickChart.Crosshair />
594
+ </CandlestickChart>
595
+ </CandlestickChart.Provider>
596
+ ```
597
+
598
+ <img src="https://user-images.githubusercontent.com/7336481/133027656-a877b248-77c1-4bf3-822f-a05dee4efa20.gif" width="200px" />
599
+
600
+ ### Interactive labels
601
+
602
+ To render an interactive label on your candlestick chart, you can use the `PriceText` or `DatetimeText` components:
603
+
604
+ > Note: These components **must** be within the `CandlestickChart.Provider` component.
605
+
606
+ ```jsx
607
+ <CandlestickChart.Provider data={data}>
608
+ <CandlestickChart>
609
+ <CandlestickChart.Candles />
610
+ <CandlestickChart.Crosshair />
611
+ </CandlestickChart>
612
+ <CandlestickChart.PriceText type="open" />
613
+ <CandlestickChart.PriceText type="high" />
614
+ <CandlestickChart.PriceText type="low" />
615
+ <CandlestickChart.PriceText type="close" />
616
+ <CandlestickChart.DatetimeText />
617
+ </LineChart.Provider>
618
+ ```
619
+
620
+ <img src="https://user-images.githubusercontent.com/7336481/133034935-faea61e6-09c2-4dba-a1ab-555d1ebee880.gif" width="200px" />
621
+
622
+ ### Interactive tooltips
623
+
624
+ To render an interactive tooltip that follows your crosshair, you can use the `Tooltip` component.
625
+
626
+ ```jsx
627
+ <CandlestickChart.Provider data={data}>
628
+ <CandlestickChart>
629
+ <CandlestickChart.Candles />
630
+ <CandlestickChart.Crosshair>
631
+ <CandlestickChart.Tooltip />
632
+ </CandlestickChart.Crosshair>
633
+ </CandlestickChart>
634
+ </CandlestickChart.Provider>
635
+ ```
636
+
637
+ <img src="https://user-images.githubusercontent.com/7336481/133036451-e1f2f12b-9e96-4a0f-8c69-4f630bb8ded3.gif" width="200px" />
638
+
639
+ ### Haptic feedback
640
+
641
+ By making use of the chart event handlers, you are able to integrate haptic feedback into your charts.
642
+
643
+ We can utilise the `onCurrentXChange` event to create haptic feedback on our candlestick chart.
644
+
645
+ ```jsx
646
+ import * as haptics from 'expo-haptics';
647
+
648
+ const data = [...];
649
+
650
+ function invokeHaptic() {
651
+ haptics.impactAsync(haptics.ImpactFeedbackStyle.Light);
652
+ }
653
+
654
+ function Example() {
655
+ return (
656
+ <CandlestickChart.Provider data={data}>
657
+ <CandlestickChart>
658
+ <CandlestickChart.Candles />
659
+ <CandlestickChart.Crosshair onCurrentXChange={invokeHaptic}>
660
+ <CandlestickChart.Tooltip />
661
+ </CandlestickChart.Crosshair>
662
+ </CandlestickChart>
663
+ </CandlestickChart.Provider>
664
+ )
665
+ }
666
+ ```
667
+
668
+ ### Colors
669
+
670
+ By default, the charts come with default colors out-of-the-box... But you probably will want to change these to suit your brand.
671
+
672
+ #### Coloring the candles
673
+
674
+ To customise the color of the candlestick chart candles, supply a `negativeColor` and a `positiveColor` to `CandlestickChart.Candles`. This can be any valid React Native `StyleSheet` compatible color.
675
+
676
+ ```jsx
677
+ <CandlestickChart.Provider data={data}>
678
+ <CandlestickChart>
679
+ <CandlestickChart.Candles positiveColor="hotpink" negativeColor="black" />
680
+ </CandlestickChart>
681
+ </CandlestickChart.Provider>
682
+ ```
683
+
684
+ <img width="200px" alt="Screen Shot 2021-09-13 at 4 58 52 pm" src="https://user-images.githubusercontent.com/7336481/133037949-aba76daa-20bb-4d4e-b05e-b0cff42b69a6.png">
685
+
686
+ #### Coloring the crosshair
687
+
688
+ To customise the color of the line chart cursor, supply a `color` prop to `CandlestickChart.Crosshair`. This can be any valid React Native `StyleSheet` compatible color.
689
+
690
+ ```jsx
691
+ <CandlestickChart.Provider data={data}>
692
+ <CandlestickChart>
693
+ <CandlestickChart.Candles positiveColor="hotpink" negativeColor="black" />
694
+ <CandlestickChart.Crosshair color="hotpink" />
695
+ </CandlestickChart>
696
+ </CandlestickChart.Provider>
697
+ ```
698
+
699
+ <img width="200px" alt="Screen Shot 2021-09-13 at 4 58 52 pm" src="https://user-images.githubusercontent.com/7336481/133038181-33ee91bf-a5e2-4124-ab7b-df745a5ba804.gif">
700
+
701
+ ### Customizing labels
702
+
703
+ #### Price labels
704
+
705
+ ##### Precision
706
+
707
+ By default, the price labels have a precision of `2`, meaning that the prices will always be to 2 decimal places. However, you can customize this with the `precision` prop:
708
+
709
+ ```jsx
710
+ <CandlestickChart.PriceText precision={4} />
711
+ ```
712
+
713
+ ##### Custom formatting
714
+
715
+ To customize the formatting of the price text, you can supply a `format` function in the form of a [reanimated worklet](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/worklets):
716
+
717
+ > Note: due to the nature of reanimated worklets, you cannot define functions that run on the React Native JS thread. [Read more here](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/worklets)
718
+
719
+ ```jsx
720
+ <CandlestickChart.PriceText
721
+ format={({ value }) => {
722
+ 'worklet';
723
+ const formattedPrice = yourOwnFormatValueFn(value);
724
+ return `$${formattedPrice} AUD`;
725
+ }}
726
+ />
727
+ ```
728
+
729
+ #### Datetime labels
730
+
731
+ ##### Date/time options
732
+
733
+ Internally, WAGMI charts uses [`Date.prototype.toLocaleString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString) to generate the date/time label. You can customise it's options like so:
734
+
735
+ ```jsx
736
+ <CandlestickChart.DatetimeText
737
+ locale="en-AU"
738
+ options={{
739
+ year: 'numeric',
740
+ month: 'numeric',
741
+ day: 'numeric',
742
+ hour: 'numeric',
743
+ minute: 'numeric',
744
+ second: 'numeric',
745
+ }}
746
+ />
747
+ ```
748
+
749
+ ##### Custom formatting
750
+
751
+ To customize the formatting of the date/time text, you can supply a `format` function in the form of a [reanimated worklet](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/worklets):
752
+
753
+ > Note: due to the nature of reanimated worklets, you cannot define functions that run on the React Native JS thread. [Read more here](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/worklets)
754
+
755
+ ```jsx
756
+ <CandlestickChart.DatetimeText
757
+ format={({ value }) => {
758
+ 'worklet';
759
+ const formattedDate = yourOwnFormatValueFn(value);
760
+ return formattedDate;
761
+ }}
762
+ />
763
+ ```
764
+
659
765
  ## Component APIs
660
766
 
661
767
  ### LineChart.Provider
@@ -702,13 +808,42 @@ You can customize the gutters of the tooltip by providing `cursorGutter`, `xGutt
702
808
  | `color` | `string` | `"gray"` | Color of the cursor line |
703
809
  | `lineProps` | `LineProps` | | Props of the cursor line. Takes React Native SVG's `Line` props. |
704
810
 
811
+ ### LineChart.Dot
812
+
813
+ | Prop | Type | Default | Description |
814
+ | ------------------- | -------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
815
+ | `at` | `number` | | Index of followed `data` item. |
816
+ | `color` | `string` | `"black"` | Color of the dot |
817
+ | `size` | `number` | `4` | Size of the dot. |
818
+ | `inactiveColor` | `string` | | Color of the dot when the chart is inactive. |
819
+ | `showInactiveColor` | `boolean` | `true` | Whether or not to show the inactive dot when the chart is inactive. |
820
+ | `hasOuterDot` | `boolean` | `false` | Whether or not the dot has an outer circle. |
821
+ | `hasPulse` | `boolean` | `false` | Whether or not the dot has an animated pulse. |
822
+ | `outerSize` | `number` | `16` | Size of the outer dot. |
823
+ | `pulseBehaviour` | `"while-inactive"` or `"always"` | `"while-inactive"` | Behaviour of the pulse. If `always`, the outer dot will still animate when interaction is active. If `while-inactive`, the outer dot will animate only when the interaction is inactive. |
824
+ | `pulseDurationMs` | `number` | `800` | Duration in ms of the pulse animation. |
825
+ | `dotProps` | `CircleProps` | | Props of the dot (accepts React Native SVG's `Circle` props). |
826
+ | `outerDotProps` | `CircleProps` | | Props of the outer dot (accepts React Native SVG's `Circle` props). |
827
+
828
+ ### LineChart.Highlight
829
+
830
+ | Prop | Type | Default | Description |
831
+ | ------------------- | --------- | --------- | ------------------------------------------------------------------------- |
832
+ | `from` | `number` | | Data index of where to start the highlight. |
833
+ | `to` | `number` | | Data index of where to end the highlight. |
834
+ | `color` | `string` | `"black"` | Color of the highlighted path. |
835
+ | `inactiveColor` | `string` | | Color of the highlight when the chart is inactive. |
836
+ | `showInactiveColor` | `boolean` | `true` | Whether or not to show the inactive highlight when the chart is inactive. |
837
+ | `width` | `number` | `3` | Width of the highlight stroke. |
838
+
839
+
705
840
  ### LineChart.HorizontalLine
706
841
 
707
- | Prop | Type | Default | Description |
708
- | ----------- | ----------- | ----------------- | ---------------------------------------------------------------- | --- | ---------------------------------------------------------------------------------------------------------- |
709
- | `color` | `string` | `"gray"` | Color of the cursor line |
710
- | `lineProps` | `LineProps` | | Props of the cursor line. Takes React Native SVG's `Line` props. |
711
- | `at` | `number | { index: number } | { value: number }` | `0` | Index of followed `data` item. You can alternatively pass `{ value: number }`, corresponding to a y value. |
842
+ | Prop | Type | Default | Description |
843
+ | ----------- | ------------------------------------------------------ | -------- | ---------------------------------------------------------------------------------------------------------- |
844
+ | `color` | `string` | `"gray"` | Color of the cursor line |
845
+ | `lineProps` | `LineProps` | | Props of the cursor line. Takes React Native SVG's `Line` props. |
846
+ | `at` | `number` or `{ index: number }` or `{ value: number }` | `0` | Index of followed `data` item. You can alternatively pass `{ value: number }`, corresponding to a y value. |
712
847
 
713
848
  ### LineChart.Gradient
714
849
 
@@ -719,31 +854,31 @@ You can customize the gutters of the tooltip by providing `cursorGutter`, `xGutt
719
854
 
720
855
  ### LineChart.Tooltip
721
856
 
722
- | Prop | Type | Default | Description |
723
- | ---- | ---- | ------- | ----------- ||
724
- | `xGutter` | `number` | `8` | X axis gutter in which the tooltip will not pass. |
725
- | `yGutter` | `number` | `8` | Y axis gutter in which the tooltip will not pass. |
726
- | `cursorGutter` | `number` | `48` | Gutter (spacing) between the cursor and the tooltip. |
727
- | `position` | `"top" | "bottom"` | `"top"` | Position of the tooltip relative to the cursor. |
857
+ | Prop | Type | Default | Description |
858
+ | -------------- | --------------------- | ------- | ---------------------------------------------------- |
859
+ | `xGutter` | `number` | `8` | X axis gutter in which the tooltip will not pass. |
860
+ | `yGutter` | `number` | `8` | Y axis gutter in which the tooltip will not pass. |
861
+ | `cursorGutter` | `number` | `48` | Gutter (spacing) between the cursor and the tooltip. |
862
+ | `position` | `"top"` or `"bottom"` | `"top"` | Position of the tooltip relative to the cursor. |
728
863
 
729
864
  ### LineChart.PriceText
730
865
 
731
- | Prop | Type | Default | Description |
732
- | ---- | ---- | ------- | ----------- ||
733
- | `format` | `({ value, formatted }) => string` | | Custom format function of the price. |
734
- | `precision` | `number` | `2` | Default precision of the price. |
735
- | `variant` | `"formatted" | "value"` | `"formatted"` | Default representation of the price value. |
736
- | `...props` | `TextProps` | | Inherits React Native's `Text` props |
866
+ | Prop | Type | Default | Description |
867
+ | ----------- | ---------------------------------- | ------------- | ------------------------------------------ |
868
+ | `format` | `({ value, formatted }) => string` | | Custom format function of the price. |
869
+ | `precision` | `number` | `2` | Default precision of the price. |
870
+ | `variant` | `"formatted"` or `"value"` | `"formatted"` | Default representation of the price value. |
871
+ | `...props` | `TextProps` | | Inherits React Native's `Text` props |
737
872
 
738
873
  ### LineChart.DatetimeText
739
874
 
740
- | Prop | Type | Default | Description |
741
- | ---- | ---- | ------- | ----------- ||
742
- | `format` | `({ value, formatted }) => string` | | Custom format function of the timestamp. |
743
- | `locale` | `string` | `"en-US"` | Locale of the timestamp. |
744
- | `options` | `{}` | | Options to pass to `toLocaleString()`. [Available options are here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString) |
745
- | `style` | `{}` | | Style of the price text |
746
- | `variant` | `"formatted" | "value"` | `"formatted"` | Default representation of the timestamp value. |
875
+ | Prop | Type | Default | Description |
876
+ | --------- | ---------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
877
+ | `format` | `({ value, formatted }) => string` | | Custom format function of the timestamp. |
878
+ | `locale` | `string` | `"en-US"` | Locale of the timestamp. |
879
+ | `options` | `{}` | | Options to pass to `toLocaleString()`. [Available options are here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString) |
880
+ | `style` | `{}` | | Style of the price text |
881
+ | `variant` | `"formatted"` or `"value"` | `"formatted"` | Default representation of the timestamp value. |
747
882
 
748
883
  ### CandlestickChart.Provider
749
884
 
@@ -774,8 +909,8 @@ You can customize the gutters of the tooltip by providing `cursorGutter`, `xGutt
774
909
  ### CandlestickChart.Crosshair
775
910
 
776
911
  | Prop | Type | Default | Description |
777
- | ------------------ | ------------------------------ | --------- | ------------------------------------------------ | --- |
778
- | `color` | `string` | `"black"` | Color of the crosshair | |
912
+ | ------------------ | ------------------------------ | --------- | ------------------------------------------------ |
913
+ | `color` | `string` | `"black"` | Color of the crosshair |
779
914
  | `onCurrentXChange` | `(xValue: number) => void` | | Callback to invoke when the x coordinate changes |
780
915
  | `...props` | `LongPressGestureHandlerProps` | | |
781
916
 
@@ -790,22 +925,22 @@ You can customize the gutters of the tooltip by providing `cursorGutter`, `xGutt
790
925
 
791
926
  ### CandlestickChart.PriceText
792
927
 
793
- | Prop | Type | Default | Description |
794
- | ---- | ---- | ------- | ----------- ||
795
- | `format` | `({ value, formatted }) => string` | | Custom format function of the price. |
796
- | `precision` | `number` | `2` | Default precision of the price. |
797
- | `variant` | `"formatted" | "value"` | `"formatted"` | Default representation of the price value. |
798
- | `...props` | `TextProps` | | Inherits React Native's `Text` props |
928
+ | Prop | Type | Default | Description |
929
+ | ----------- | ---------------------------------- | ------------- | ------------------------------------------ |
930
+ | `format` | `({ value, formatted }) => string` | | Custom format function of the price. |
931
+ | `precision` | `number` | `2` | Default precision of the price. |
932
+ | `variant` | `"formatted"` or `"value"` | `"formatted"` | Default representation of the price value. |
933
+ | `...props` | `TextProps` | | Inherits React Native's `Text` props |
799
934
 
800
935
  ### CandlestickChart.DatetimeText
801
936
 
802
- | Prop | Type | Default | Description |
803
- | ---- | ---- | ------- | ----------- ||
804
- | `format` | `({ value, formatted }) => string` | | Custom format function of the timestamp. |
805
- | `locale` | `string` | `"en-US"` | Locale of the timestamp. |
806
- | `options` | `{}` | | Options to pass to `toLocaleString()`. [Available options are here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString) |
807
- | `style` | `{}` | | Style of the price text |
808
- | `variant` | `"formatted" | "value"` | `"formatted"` | Default representation of the timestamp value. |
937
+ | Prop | Type | Default | Description |
938
+ | --------- | ---------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
939
+ | `format` | `({ value, formatted }) => string` | | Custom format function of the timestamp. |
940
+ | `locale` | `string` | `"en-US"` | Locale of the timestamp. |
941
+ | `options` | `{}` | | Options to pass to `toLocaleString()`. [Available options are here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString) |
942
+ | `style` | `{}` | | Style of the price text |
943
+ | `variant` | `"formatted"` or `"value"` | `"formatted"` | Default representation of the timestamp value. |
809
944
 
810
945
  ## Hooks
811
946