react-native-chart-kit 7.0.0-next.1 → 7.0.0-next.3

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 (427) hide show
  1. package/README.md +89 -521
  2. package/dist/charts/line/LineChart.d.ts +3 -3
  3. package/dist/charts/line/LineChart.js +1 -1
  4. package/dist/v2/core/data/index.d.ts +3 -0
  5. package/dist/v2/core/data/index.d.ts.map +1 -0
  6. package/dist/v2/core/data/index.js +1 -0
  7. package/dist/v2/core/data/normalize.d.ts +8 -0
  8. package/dist/v2/core/data/normalize.d.ts.map +1 -0
  9. package/dist/v2/core/data/normalize.js +229 -0
  10. package/dist/v2/core/data/normalizeValues.d.ts +16 -0
  11. package/dist/v2/core/data/normalizeValues.d.ts.map +1 -0
  12. package/dist/v2/core/data/normalizeValues.js +96 -0
  13. package/dist/v2/core/data/types.d.ts +161 -0
  14. package/dist/v2/core/data/types.d.ts.map +1 -0
  15. package/dist/v2/core/data/types.js +1 -0
  16. package/dist/v2/core/geometry/areaPath.d.ts +3 -0
  17. package/dist/v2/core/geometry/areaPath.d.ts.map +1 -0
  18. package/dist/v2/core/geometry/areaPath.js +36 -0
  19. package/dist/v2/core/geometry/barRects.d.ts +44 -0
  20. package/dist/v2/core/geometry/barRects.d.ts.map +1 -0
  21. package/dist/v2/core/geometry/barRects.js +201 -0
  22. package/dist/v2/core/geometry/contributionHeatmap.d.ts +49 -0
  23. package/dist/v2/core/geometry/contributionHeatmap.d.ts.map +1 -0
  24. package/dist/v2/core/geometry/contributionHeatmap.js +107 -0
  25. package/dist/v2/core/geometry/horizontalBarRects.d.ts +27 -0
  26. package/dist/v2/core/geometry/horizontalBarRects.d.ts.map +1 -0
  27. package/dist/v2/core/geometry/horizontalBarRects.js +202 -0
  28. package/dist/v2/core/geometry/index.d.ts +12 -0
  29. package/dist/v2/core/geometry/index.d.ts.map +1 -0
  30. package/dist/v2/core/geometry/index.js +11 -0
  31. package/dist/v2/core/geometry/lineDecimation.d.ts +8 -0
  32. package/dist/v2/core/geometry/lineDecimation.d.ts.map +1 -0
  33. package/dist/v2/core/geometry/lineDecimation.js +110 -0
  34. package/dist/v2/core/geometry/linePath.d.ts +5 -0
  35. package/dist/v2/core/geometry/linePath.d.ts.map +1 -0
  36. package/dist/v2/core/geometry/linePath.js +98 -0
  37. package/dist/v2/core/geometry/lineSeries.d.ts +29 -0
  38. package/dist/v2/core/geometry/lineSeries.d.ts.map +1 -0
  39. package/dist/v2/core/geometry/lineSeries.js +51 -0
  40. package/dist/v2/core/geometry/path.d.ts +6 -0
  41. package/dist/v2/core/geometry/path.d.ts.map +1 -0
  42. package/dist/v2/core/geometry/path.js +24 -0
  43. package/dist/v2/core/geometry/pieArcs.d.ts +29 -0
  44. package/dist/v2/core/geometry/pieArcs.d.ts.map +1 -0
  45. package/dist/v2/core/geometry/pieArcs.js +142 -0
  46. package/dist/v2/core/geometry/progressRings.d.ts +30 -0
  47. package/dist/v2/core/geometry/progressRings.d.ts.map +1 -0
  48. package/dist/v2/core/geometry/progressRings.js +104 -0
  49. package/dist/v2/core/geometry/types.d.ts +32 -0
  50. package/dist/v2/core/geometry/types.d.ts.map +1 -0
  51. package/dist/v2/core/geometry/types.js +1 -0
  52. package/dist/v2/core/index.d.ts +6 -0
  53. package/dist/v2/core/index.d.ts.map +1 -0
  54. package/dist/v2/core/index.js +6 -0
  55. package/dist/v2/core/interaction/index.d.ts +5 -0
  56. package/dist/v2/core/interaction/index.d.ts.map +1 -0
  57. package/dist/v2/core/interaction/index.js +2 -0
  58. package/dist/v2/core/interaction/viewport.d.ts +71 -0
  59. package/dist/v2/core/interaction/viewport.d.ts.map +1 -0
  60. package/dist/v2/core/interaction/viewport.js +216 -0
  61. package/dist/v2/core/interaction/viewportTransform.d.ts +17 -0
  62. package/dist/v2/core/interaction/viewportTransform.d.ts.map +1 -0
  63. package/dist/v2/core/interaction/viewportTransform.js +70 -0
  64. package/dist/v2/core/layout/autoPadding.d.ts +3 -0
  65. package/dist/v2/core/layout/autoPadding.d.ts.map +1 -0
  66. package/dist/v2/core/layout/autoPadding.js +33 -0
  67. package/dist/v2/core/layout/chartBox.d.ts +5 -0
  68. package/dist/v2/core/layout/chartBox.d.ts.map +1 -0
  69. package/dist/v2/core/layout/chartBox.js +22 -0
  70. package/dist/v2/core/layout/debugLayout.d.ts +3 -0
  71. package/dist/v2/core/layout/debugLayout.d.ts.map +1 -0
  72. package/dist/v2/core/layout/debugLayout.js +20 -0
  73. package/dist/v2/core/layout/index.d.ts +8 -0
  74. package/dist/v2/core/layout/index.d.ts.map +1 -0
  75. package/dist/v2/core/layout/index.js +6 -0
  76. package/dist/v2/core/layout/labelCollision.d.ts +3 -0
  77. package/dist/v2/core/layout/labelCollision.d.ts.map +1 -0
  78. package/dist/v2/core/layout/labelCollision.js +90 -0
  79. package/dist/v2/core/layout/legendLayout.d.ts +3 -0
  80. package/dist/v2/core/layout/legendLayout.d.ts.map +1 -0
  81. package/dist/v2/core/layout/legendLayout.js +39 -0
  82. package/dist/v2/core/layout/tooltipPlacement.d.ts +3 -0
  83. package/dist/v2/core/layout/tooltipPlacement.d.ts.map +1 -0
  84. package/dist/v2/core/layout/tooltipPlacement.js +76 -0
  85. package/dist/v2/core/layout/types.d.ts +114 -0
  86. package/dist/v2/core/layout/types.d.ts.map +1 -0
  87. package/dist/v2/core/layout/types.js +1 -0
  88. package/dist/v2/core/scales/band.d.ts +15 -0
  89. package/dist/v2/core/scales/band.d.ts.map +1 -0
  90. package/dist/v2/core/scales/band.js +34 -0
  91. package/dist/v2/core/scales/domain.d.ts +6 -0
  92. package/dist/v2/core/scales/domain.d.ts.map +1 -0
  93. package/dist/v2/core/scales/domain.js +109 -0
  94. package/dist/v2/core/scales/index.d.ts +7 -0
  95. package/dist/v2/core/scales/index.d.ts.map +1 -0
  96. package/dist/v2/core/scales/index.js +5 -0
  97. package/dist/v2/core/scales/linear.d.ts +8 -0
  98. package/dist/v2/core/scales/linear.d.ts.map +1 -0
  99. package/dist/v2/core/scales/linear.js +22 -0
  100. package/dist/v2/core/scales/ticks.d.ts +4 -0
  101. package/dist/v2/core/scales/ticks.d.ts.map +1 -0
  102. package/dist/v2/core/scales/ticks.js +111 -0
  103. package/dist/v2/core/scales/time.d.ts +8 -0
  104. package/dist/v2/core/scales/time.d.ts.map +1 -0
  105. package/dist/v2/core/scales/time.js +23 -0
  106. package/dist/v2/core/scales/types.d.ts +46 -0
  107. package/dist/v2/core/scales/types.d.ts.map +1 -0
  108. package/dist/v2/core/scales/types.js +1 -0
  109. package/dist/v2/index.d.ts +1 -0
  110. package/dist/v2/index.js +1 -0
  111. package/dist/v2/react-native/charts/bar/BarChart.d.ts +6 -0
  112. package/dist/v2/react-native/charts/bar/BarChart.d.ts.map +1 -0
  113. package/dist/v2/react-native/charts/bar/BarChart.js +199 -0
  114. package/dist/v2/react-native/charts/bar/BarChartSurface.d.ts +36 -0
  115. package/dist/v2/react-native/charts/bar/BarChartSurface.d.ts.map +1 -0
  116. package/dist/v2/react-native/charts/bar/BarChartSurface.js +134 -0
  117. package/dist/v2/react-native/charts/bar/StackedBarChart.d.ts +4 -0
  118. package/dist/v2/react-native/charts/bar/StackedBarChart.d.ts.map +1 -0
  119. package/dist/v2/react-native/charts/bar/StackedBarChart.js +9 -0
  120. package/dist/v2/react-native/charts/bar/accessibility.d.ts +31 -0
  121. package/dist/v2/react-native/charts/bar/accessibility.d.ts.map +1 -0
  122. package/dist/v2/react-native/charts/bar/accessibility.js +87 -0
  123. package/dist/v2/react-native/charts/bar/interaction.d.ts +18 -0
  124. package/dist/v2/react-native/charts/bar/interaction.d.ts.map +1 -0
  125. package/dist/v2/react-native/charts/bar/interaction.js +62 -0
  126. package/dist/v2/react-native/charts/bar/model.d.ts +3 -0
  127. package/dist/v2/react-native/charts/bar/model.d.ts.map +1 -0
  128. package/dist/v2/react-native/charts/bar/model.js +326 -0
  129. package/dist/v2/react-native/charts/bar/modelUtils.d.ts +27 -0
  130. package/dist/v2/react-native/charts/bar/modelUtils.d.ts.map +1 -0
  131. package/dist/v2/react-native/charts/bar/modelUtils.js +58 -0
  132. package/dist/v2/react-native/charts/bar/options.d.ts +7 -0
  133. package/dist/v2/react-native/charts/bar/options.d.ts.map +1 -0
  134. package/dist/v2/react-native/charts/bar/options.js +49 -0
  135. package/dist/v2/react-native/charts/bar/rendererSafety.d.ts +12 -0
  136. package/dist/v2/react-native/charts/bar/rendererSafety.d.ts.map +1 -0
  137. package/dist/v2/react-native/charts/bar/rendererSafety.js +31 -0
  138. package/dist/v2/react-native/charts/bar/selectionAnimation.d.ts +42 -0
  139. package/dist/v2/react-native/charts/bar/selectionAnimation.d.ts.map +1 -0
  140. package/dist/v2/react-native/charts/bar/selectionAnimation.js +158 -0
  141. package/dist/v2/react-native/charts/bar/stackedCompat.d.ts +55 -0
  142. package/dist/v2/react-native/charts/bar/stackedCompat.d.ts.map +1 -0
  143. package/dist/v2/react-native/charts/bar/stackedCompat.js +105 -0
  144. package/dist/v2/react-native/charts/bar/tooltip.d.ts +11 -0
  145. package/dist/v2/react-native/charts/bar/tooltip.d.ts.map +1 -0
  146. package/dist/v2/react-native/charts/bar/tooltip.js +18 -0
  147. package/dist/v2/react-native/charts/bar/tooltipModel.d.ts +33 -0
  148. package/dist/v2/react-native/charts/bar/tooltipModel.d.ts.map +1 -0
  149. package/dist/v2/react-native/charts/bar/tooltipModel.js +46 -0
  150. package/dist/v2/react-native/charts/bar/tooltipPlacement.d.ts +9 -0
  151. package/dist/v2/react-native/charts/bar/tooltipPlacement.d.ts.map +1 -0
  152. package/dist/v2/react-native/charts/bar/tooltipPlacement.js +9 -0
  153. package/dist/v2/react-native/charts/bar/types.d.ts +211 -0
  154. package/dist/v2/react-native/charts/bar/types.d.ts.map +1 -0
  155. package/dist/v2/react-native/charts/bar/types.js +1 -0
  156. package/dist/v2/react-native/charts/bar/useAnimatedTooltipModel.d.ts +10 -0
  157. package/dist/v2/react-native/charts/bar/useAnimatedTooltipModel.d.ts.map +1 -0
  158. package/dist/v2/react-native/charts/bar/useAnimatedTooltipModel.js +87 -0
  159. package/dist/v2/react-native/charts/bar/viewport.d.ts +20 -0
  160. package/dist/v2/react-native/charts/bar/viewport.d.ts.map +1 -0
  161. package/dist/v2/react-native/charts/bar/viewport.js +47 -0
  162. package/dist/v2/react-native/charts/contribution/ContributionGraph.d.ts +13 -0
  163. package/dist/v2/react-native/charts/contribution/ContributionGraph.d.ts.map +1 -0
  164. package/dist/v2/react-native/charts/contribution/ContributionGraph.js +159 -0
  165. package/dist/v2/react-native/charts/contribution/accessibility.d.ts +25 -0
  166. package/dist/v2/react-native/charts/contribution/accessibility.d.ts.map +1 -0
  167. package/dist/v2/react-native/charts/contribution/accessibility.js +50 -0
  168. package/dist/v2/react-native/charts/contribution/interaction.d.ts +23 -0
  169. package/dist/v2/react-native/charts/contribution/interaction.d.ts.map +1 -0
  170. package/dist/v2/react-native/charts/contribution/interaction.js +75 -0
  171. package/dist/v2/react-native/charts/contribution/model.d.ts +17 -0
  172. package/dist/v2/react-native/charts/contribution/model.d.ts.map +1 -0
  173. package/dist/v2/react-native/charts/contribution/model.js +102 -0
  174. package/dist/v2/react-native/charts/contribution/types.d.ts +71 -0
  175. package/dist/v2/react-native/charts/contribution/types.d.ts.map +1 -0
  176. package/dist/v2/react-native/charts/contribution/types.js +1 -0
  177. package/dist/v2/react-native/charts/line/AreaChart.d.ts +3 -0
  178. package/dist/v2/react-native/charts/line/AreaChart.d.ts.map +1 -0
  179. package/dist/v2/react-native/charts/line/AreaChart.js +3 -0
  180. package/dist/v2/react-native/charts/line/ChartSurface.d.ts +16 -0
  181. package/dist/v2/react-native/charts/line/ChartSurface.d.ts.map +1 -0
  182. package/dist/v2/react-native/charts/line/ChartSurface.js +151 -0
  183. package/dist/v2/react-native/charts/line/LineChart.d.ts +6 -0
  184. package/dist/v2/react-native/charts/line/LineChart.d.ts.map +1 -0
  185. package/dist/v2/react-native/charts/line/LineChart.js +294 -0
  186. package/dist/v2/react-native/charts/line/StickyYAxis.d.ts +15 -0
  187. package/dist/v2/react-native/charts/line/StickyYAxis.d.ts.map +1 -0
  188. package/dist/v2/react-native/charts/line/StickyYAxis.js +26 -0
  189. package/dist/v2/react-native/charts/line/accessibility.d.ts +34 -0
  190. package/dist/v2/react-native/charts/line/accessibility.d.ts.map +1 -0
  191. package/dist/v2/react-native/charts/line/accessibility.js +103 -0
  192. package/dist/v2/react-native/charts/line/axisLabels.d.ts +37 -0
  193. package/dist/v2/react-native/charts/line/axisLabels.d.ts.map +1 -0
  194. package/dist/v2/react-native/charts/line/axisLabels.js +55 -0
  195. package/dist/v2/react-native/charts/line/debugLayout.d.ts +26 -0
  196. package/dist/v2/react-native/charts/line/debugLayout.d.ts.map +1 -0
  197. package/dist/v2/react-native/charts/line/debugLayout.js +77 -0
  198. package/dist/v2/react-native/charts/line/debugOverlay.d.ts +9 -0
  199. package/dist/v2/react-native/charts/line/debugOverlay.d.ts.map +1 -0
  200. package/dist/v2/react-native/charts/line/debugOverlay.js +30 -0
  201. package/dist/v2/react-native/charts/line/defaultTooltip.d.ts +3 -0
  202. package/dist/v2/react-native/charts/line/defaultTooltip.d.ts.map +1 -0
  203. package/dist/v2/react-native/charts/line/defaultTooltip.js +17 -0
  204. package/dist/v2/react-native/charts/line/interaction.d.ts +82 -0
  205. package/dist/v2/react-native/charts/line/interaction.d.ts.map +1 -0
  206. package/dist/v2/react-native/charts/line/interaction.js +94 -0
  207. package/dist/v2/react-native/charts/line/legend.d.ts +35 -0
  208. package/dist/v2/react-native/charts/line/legend.d.ts.map +1 -0
  209. package/dist/v2/react-native/charts/line/legend.js +95 -0
  210. package/dist/v2/react-native/charts/line/markers.d.ts +11 -0
  211. package/dist/v2/react-native/charts/line/markers.d.ts.map +1 -0
  212. package/dist/v2/react-native/charts/line/markers.js +52 -0
  213. package/dist/v2/react-native/charts/line/options.d.ts +172 -0
  214. package/dist/v2/react-native/charts/line/options.d.ts.map +1 -0
  215. package/dist/v2/react-native/charts/line/options.js +168 -0
  216. package/dist/v2/react-native/charts/line/outsidePressSurfaces.d.ts +15 -0
  217. package/dist/v2/react-native/charts/line/outsidePressSurfaces.d.ts.map +1 -0
  218. package/dist/v2/react-native/charts/line/outsidePressSurfaces.js +37 -0
  219. package/dist/v2/react-native/charts/line/overviewProps.d.ts +45 -0
  220. package/dist/v2/react-native/charts/line/overviewProps.d.ts.map +1 -0
  221. package/dist/v2/react-native/charts/line/overviewProps.js +4 -0
  222. package/dist/v2/react-native/charts/line/rangeSelector.d.ts +19 -0
  223. package/dist/v2/react-native/charts/line/rangeSelector.d.ts.map +1 -0
  224. package/dist/v2/react-native/charts/line/rangeSelector.js +185 -0
  225. package/dist/v2/react-native/charts/line/rangeSelectorConfig.d.ts +38 -0
  226. package/dist/v2/react-native/charts/line/rangeSelectorConfig.d.ts.map +1 -0
  227. package/dist/v2/react-native/charts/line/rangeSelectorConfig.js +41 -0
  228. package/dist/v2/react-native/charts/line/referenceLabelPlacement.d.ts +21 -0
  229. package/dist/v2/react-native/charts/line/referenceLabelPlacement.d.ts.map +1 -0
  230. package/dist/v2/react-native/charts/line/referenceLabelPlacement.js +113 -0
  231. package/dist/v2/react-native/charts/line/references.d.ts +62 -0
  232. package/dist/v2/react-native/charts/line/references.d.ts.map +1 -0
  233. package/dist/v2/react-native/charts/line/references.js +156 -0
  234. package/dist/v2/react-native/charts/line/renderer.d.ts +4 -0
  235. package/dist/v2/react-native/charts/line/renderer.d.ts.map +1 -0
  236. package/dist/v2/react-native/charts/line/renderer.js +23 -0
  237. package/dist/v2/react-native/charts/line/responders.d.ts +13 -0
  238. package/dist/v2/react-native/charts/line/responders.d.ts.map +1 -0
  239. package/dist/v2/react-native/charts/line/responders.js +62 -0
  240. package/dist/v2/react-native/charts/line/selection.d.ts +31 -0
  241. package/dist/v2/react-native/charts/line/selection.d.ts.map +1 -0
  242. package/dist/v2/react-native/charts/line/selection.js +26 -0
  243. package/dist/v2/react-native/charts/line/seriesInput.d.ts +4 -0
  244. package/dist/v2/react-native/charts/line/seriesInput.d.ts.map +1 -0
  245. package/dist/v2/react-native/charts/line/seriesInput.js +13 -0
  246. package/dist/v2/react-native/charts/line/seriesStyles.d.ts +20 -0
  247. package/dist/v2/react-native/charts/line/seriesStyles.d.ts.map +1 -0
  248. package/dist/v2/react-native/charts/line/seriesStyles.js +33 -0
  249. package/dist/v2/react-native/charts/line/stickyYAxisLayout.d.ts +6 -0
  250. package/dist/v2/react-native/charts/line/stickyYAxisLayout.d.ts.map +1 -0
  251. package/dist/v2/react-native/charts/line/stickyYAxisLayout.js +2 -0
  252. package/dist/v2/react-native/charts/line/text.d.ts +7 -0
  253. package/dist/v2/react-native/charts/line/text.d.ts.map +1 -0
  254. package/dist/v2/react-native/charts/line/text.js +7 -0
  255. package/dist/v2/react-native/charts/line/thresholdRendering.d.ts +28 -0
  256. package/dist/v2/react-native/charts/line/thresholdRendering.d.ts.map +1 -0
  257. package/dist/v2/react-native/charts/line/thresholdRendering.js +145 -0
  258. package/dist/v2/react-native/charts/line/tooltip.d.ts +70 -0
  259. package/dist/v2/react-native/charts/line/tooltip.d.ts.map +1 -0
  260. package/dist/v2/react-native/charts/line/tooltip.js +87 -0
  261. package/dist/v2/react-native/charts/line/types.d.ts +371 -0
  262. package/dist/v2/react-native/charts/line/types.d.ts.map +1 -0
  263. package/dist/v2/react-native/charts/line/types.js +1 -0
  264. package/dist/v2/react-native/charts/line/useAnimatedTooltipModel.d.ts +13 -0
  265. package/dist/v2/react-native/charts/line/useAnimatedTooltipModel.d.ts.map +1 -0
  266. package/dist/v2/react-native/charts/line/useAnimatedTooltipModel.js +84 -0
  267. package/dist/v2/react-native/charts/line/useAnimatedYAxisLabels.d.ts +5 -0
  268. package/dist/v2/react-native/charts/line/useAnimatedYAxisLabels.d.ts.map +1 -0
  269. package/dist/v2/react-native/charts/line/useAnimatedYAxisLabels.js +141 -0
  270. package/dist/v2/react-native/charts/line/useChartModel.d.ts +103 -0
  271. package/dist/v2/react-native/charts/line/useChartModel.d.ts.map +1 -0
  272. package/dist/v2/react-native/charts/line/useChartModel.js +367 -0
  273. package/dist/v2/react-native/charts/line/useDebugLayout.d.ts +16 -0
  274. package/dist/v2/react-native/charts/line/useDebugLayout.d.ts.map +1 -0
  275. package/dist/v2/react-native/charts/line/useDebugLayout.js +35 -0
  276. package/dist/v2/react-native/charts/line/utils.d.ts +10 -0
  277. package/dist/v2/react-native/charts/line/utils.d.ts.map +1 -0
  278. package/dist/v2/react-native/charts/line/utils.js +40 -0
  279. package/dist/v2/react-native/charts/line/viewportInteraction.d.ts +3 -0
  280. package/dist/v2/react-native/charts/line/viewportInteraction.d.ts.map +1 -0
  281. package/dist/v2/react-native/charts/line/viewportInteraction.js +1 -0
  282. package/dist/v2/react-native/charts/line/viewportPinchZoom.d.ts +2 -0
  283. package/dist/v2/react-native/charts/line/viewportPinchZoom.d.ts.map +1 -0
  284. package/dist/v2/react-native/charts/line/viewportPinchZoom.js +1 -0
  285. package/dist/v2/react-native/charts/line/xLabelCandidates.d.ts +13 -0
  286. package/dist/v2/react-native/charts/line/xLabelCandidates.d.ts.map +1 -0
  287. package/dist/v2/react-native/charts/line/xLabelCandidates.js +23 -0
  288. package/dist/v2/react-native/charts/line/xLabels.d.ts +39 -0
  289. package/dist/v2/react-native/charts/line/xLabels.d.ts.map +1 -0
  290. package/dist/v2/react-native/charts/line/xLabels.js +289 -0
  291. package/dist/v2/react-native/charts/line/xScale.d.ts +6 -0
  292. package/dist/v2/react-native/charts/line/xScale.d.ts.map +1 -0
  293. package/dist/v2/react-native/charts/line/xScale.js +25 -0
  294. package/dist/v2/react-native/charts/line/yAxisModel.d.ts +29 -0
  295. package/dist/v2/react-native/charts/line/yAxisModel.d.ts.map +1 -0
  296. package/dist/v2/react-native/charts/line/yAxisModel.js +39 -0
  297. package/dist/v2/react-native/charts/pie/PieChart.d.ts +7 -0
  298. package/dist/v2/react-native/charts/pie/PieChart.d.ts.map +1 -0
  299. package/dist/v2/react-native/charts/pie/PieChart.js +253 -0
  300. package/dist/v2/react-native/charts/pie/accessibility.d.ts +28 -0
  301. package/dist/v2/react-native/charts/pie/accessibility.d.ts.map +1 -0
  302. package/dist/v2/react-native/charts/pie/accessibility.js +49 -0
  303. package/dist/v2/react-native/charts/pie/activeSlice.d.ts +15 -0
  304. package/dist/v2/react-native/charts/pie/activeSlice.d.ts.map +1 -0
  305. package/dist/v2/react-native/charts/pie/activeSlice.js +26 -0
  306. package/dist/v2/react-native/charts/pie/arcLabels.d.ts +32 -0
  307. package/dist/v2/react-native/charts/pie/arcLabels.d.ts.map +1 -0
  308. package/dist/v2/react-native/charts/pie/arcLabels.js +191 -0
  309. package/dist/v2/react-native/charts/pie/interaction.d.ts +26 -0
  310. package/dist/v2/react-native/charts/pie/interaction.d.ts.map +1 -0
  311. package/dist/v2/react-native/charts/pie/interaction.js +66 -0
  312. package/dist/v2/react-native/charts/pie/model.d.ts +15 -0
  313. package/dist/v2/react-native/charts/pie/model.d.ts.map +1 -0
  314. package/dist/v2/react-native/charts/pie/model.js +157 -0
  315. package/dist/v2/react-native/charts/pie/selectionAnimation.d.ts +33 -0
  316. package/dist/v2/react-native/charts/pie/selectionAnimation.d.ts.map +1 -0
  317. package/dist/v2/react-native/charts/pie/selectionAnimation.js +121 -0
  318. package/dist/v2/react-native/charts/pie/sliceSeparator.d.ts +7 -0
  319. package/dist/v2/react-native/charts/pie/sliceSeparator.d.ts.map +1 -0
  320. package/dist/v2/react-native/charts/pie/sliceSeparator.js +26 -0
  321. package/dist/v2/react-native/charts/pie/slices.d.ts +20 -0
  322. package/dist/v2/react-native/charts/pie/slices.d.ts.map +1 -0
  323. package/dist/v2/react-native/charts/pie/slices.js +54 -0
  324. package/dist/v2/react-native/charts/pie/types.d.ts +165 -0
  325. package/dist/v2/react-native/charts/pie/types.d.ts.map +1 -0
  326. package/dist/v2/react-native/charts/pie/types.js +1 -0
  327. package/dist/v2/react-native/charts/progress/ProgressChart.d.ts +7 -0
  328. package/dist/v2/react-native/charts/progress/ProgressChart.d.ts.map +1 -0
  329. package/dist/v2/react-native/charts/progress/ProgressChart.js +111 -0
  330. package/dist/v2/react-native/charts/progress/accessibility.d.ts +26 -0
  331. package/dist/v2/react-native/charts/progress/accessibility.d.ts.map +1 -0
  332. package/dist/v2/react-native/charts/progress/accessibility.js +71 -0
  333. package/dist/v2/react-native/charts/progress/animation.d.ts +36 -0
  334. package/dist/v2/react-native/charts/progress/animation.d.ts.map +1 -0
  335. package/dist/v2/react-native/charts/progress/animation.js +103 -0
  336. package/dist/v2/react-native/charts/progress/model.d.ts +14 -0
  337. package/dist/v2/react-native/charts/progress/model.d.ts.map +1 -0
  338. package/dist/v2/react-native/charts/progress/model.js +133 -0
  339. package/dist/v2/react-native/charts/progress/types.d.ts +72 -0
  340. package/dist/v2/react-native/charts/progress/types.d.ts.map +1 -0
  341. package/dist/v2/react-native/charts/progress/types.js +1 -0
  342. package/dist/v2/react-native/index.d.ts +24 -0
  343. package/dist/v2/react-native/index.d.ts.map +1 -0
  344. package/dist/v2/react-native/index.js +14 -0
  345. package/dist/v2/react-native/selection/ChartSelectionProvider.d.ts +27 -0
  346. package/dist/v2/react-native/selection/ChartSelectionProvider.d.ts.map +1 -0
  347. package/dist/v2/react-native/selection/ChartSelectionProvider.js +92 -0
  348. package/dist/v2/react-native/selection/index.d.ts +2 -0
  349. package/dist/v2/react-native/selection/index.d.ts.map +1 -0
  350. package/dist/v2/react-native/selection/index.js +1 -0
  351. package/dist/v2/react-native/selection/scope.d.ts +16 -0
  352. package/dist/v2/react-native/selection/scope.d.ts.map +1 -0
  353. package/dist/v2/react-native/selection/scope.js +18 -0
  354. package/dist/v2/react-native/theme/index.d.ts +4 -0
  355. package/dist/v2/react-native/theme/index.d.ts.map +1 -0
  356. package/dist/v2/react-native/theme/index.js +2 -0
  357. package/dist/v2/react-native/theme/presets.d.ts +84 -0
  358. package/dist/v2/react-native/theme/presets.d.ts.map +1 -0
  359. package/dist/v2/react-native/theme/presets.js +298 -0
  360. package/dist/v2/react-native/theme/provider.d.ts +20 -0
  361. package/dist/v2/react-native/theme/provider.d.ts.map +1 -0
  362. package/dist/v2/react-native/theme/provider.js +27 -0
  363. package/dist/v2/react-native/viewport/bounds.d.ts +7 -0
  364. package/dist/v2/react-native/viewport/bounds.d.ts.map +1 -0
  365. package/dist/v2/react-native/viewport/bounds.js +7 -0
  366. package/dist/v2/react-native/viewport/config.d.ts +13 -0
  367. package/dist/v2/react-native/viewport/config.d.ts.map +1 -0
  368. package/dist/v2/react-native/viewport/config.js +64 -0
  369. package/dist/v2/react-native/viewport/pan.d.ts +23 -0
  370. package/dist/v2/react-native/viewport/pan.d.ts.map +1 -0
  371. package/dist/v2/react-native/viewport/pan.js +110 -0
  372. package/dist/v2/react-native/viewport/pinchZoom.d.ts +17 -0
  373. package/dist/v2/react-native/viewport/pinchZoom.d.ts.map +1 -0
  374. package/dist/v2/react-native/viewport/pinchZoom.js +131 -0
  375. package/dist/v2/react-native/viewport/types.d.ts +55 -0
  376. package/dist/v2/react-native/viewport/types.d.ts.map +1 -0
  377. package/dist/v2/react-native/viewport/types.js +1 -0
  378. package/dist/v2/svg-renderer/capabilities.d.ts +3 -0
  379. package/dist/v2/svg-renderer/capabilities.d.ts.map +1 -0
  380. package/dist/v2/svg-renderer/capabilities.js +12 -0
  381. package/dist/v2/svg-renderer/clipPath.d.ts +4 -0
  382. package/dist/v2/svg-renderer/clipPath.d.ts.map +1 -0
  383. package/dist/v2/svg-renderer/clipPath.js +35 -0
  384. package/dist/v2/svg-renderer/defs.d.ts +6 -0
  385. package/dist/v2/svg-renderer/defs.d.ts.map +1 -0
  386. package/dist/v2/svg-renderer/defs.js +18 -0
  387. package/dist/v2/svg-renderer/ensureConsole.d.ts +4 -0
  388. package/dist/v2/svg-renderer/ensureConsole.d.ts.map +1 -0
  389. package/dist/v2/svg-renderer/ensureConsole.js +54 -0
  390. package/dist/v2/svg-renderer/hitRegions.d.ts +3 -0
  391. package/dist/v2/svg-renderer/hitRegions.d.ts.map +1 -0
  392. package/dist/v2/svg-renderer/hitRegions.js +6 -0
  393. package/dist/v2/svg-renderer/index.d.ts +14 -0
  394. package/dist/v2/svg-renderer/index.d.ts.map +1 -0
  395. package/dist/v2/svg-renderer/index.js +13 -0
  396. package/dist/v2/svg-renderer/layerOrder.d.ts +19 -0
  397. package/dist/v2/svg-renderer/layerOrder.d.ts.map +1 -0
  398. package/dist/v2/svg-renderer/layerOrder.js +18 -0
  399. package/dist/v2/svg-renderer/layers.d.ts +3 -0
  400. package/dist/v2/svg-renderer/layers.d.ts.map +1 -0
  401. package/dist/v2/svg-renderer/layers.js +4 -0
  402. package/dist/v2/svg-renderer/primitives.d.ts +12 -0
  403. package/dist/v2/svg-renderer/primitives.d.ts.map +1 -0
  404. package/dist/v2/svg-renderer/primitives.js +13 -0
  405. package/dist/v2/svg-renderer/renderer.d.ts +4 -0
  406. package/dist/v2/svg-renderer/renderer.d.ts.map +1 -0
  407. package/dist/v2/svg-renderer/renderer.js +24 -0
  408. package/dist/v2/svg-renderer/symbolGeometry.d.ts +6 -0
  409. package/dist/v2/svg-renderer/symbolGeometry.d.ts.map +1 -0
  410. package/dist/v2/svg-renderer/symbolGeometry.js +10 -0
  411. package/dist/v2/svg-renderer/symbols.d.ts +3 -0
  412. package/dist/v2/svg-renderer/symbols.d.ts.map +1 -0
  413. package/dist/v2/svg-renderer/symbols.js +23 -0
  414. package/dist/v2/svg-renderer/testIds.d.ts +2 -0
  415. package/dist/v2/svg-renderer/testIds.d.ts.map +1 -0
  416. package/dist/v2/svg-renderer/testIds.js +10 -0
  417. package/dist/v2/svg-renderer/textMeasurement.d.ts +4 -0
  418. package/dist/v2/svg-renderer/textMeasurement.d.ts.map +1 -0
  419. package/dist/v2/svg-renderer/textMeasurement.js +37 -0
  420. package/dist/v2/svg-renderer/types.d.ts +134 -0
  421. package/dist/v2/svg-renderer/types.d.ts.map +1 -0
  422. package/dist/v2/svg-renderer/types.js +1 -0
  423. package/package.json +56 -50
  424. package/v2/index.d.ts +1 -0
  425. package/v2/index.js +1 -0
  426. package/v2/package.json +6 -0
  427. package/scripts/chartkit-codemod.mjs +0 -256
package/README.md CHANGED
@@ -1,540 +1,108 @@
1
- If you're looking to **build a website or a cross-platform mobile app** – we will be happy to help you! Send a note to clients@ui1.io and we will be in touch with you shortly.
1
+ <div align="center">
2
+ <a href="https://chartkit.io/">
3
+ <img src="https://chartkit.io/images/logo.svg" alt="React Native Chart Kit" width="72" />
4
+ </a>
2
5
 
3
- ![Chart Kit](https://i.imgur.com/Idp4WIX.jpg)
6
+ <h1>React Native Chart Kit</h1>
4
7
 
5
- [📲See example app](https://github.com/indiespirit/react-native-chart-kit-example)
8
+ <p>
9
+ Beautiful charts for React Native. SVG by default, interaction-ready, and
10
+ built for modern app screens.
11
+ </p>
6
12
 
7
- # React Native Chart Kit Documentation
13
+ <p>
14
+ <a href="https://www.npmjs.com/package/react-native-chart-kit"><img alt="npm" src="https://img.shields.io/npm/v/react-native-chart-kit?style=flat-square" /></a>
15
+ <a href="https://www.npmjs.com/package/react-native-chart-kit"><img alt="downloads" src="https://img.shields.io/npm/dm/react-native-chart-kit?style=flat-square" /></a>
16
+ <a href="./LICENSE"><img alt="license" src="https://img.shields.io/npm/l/react-native-chart-kit?style=flat-square" /></a>
17
+ </p>
8
18
 
9
- ## Chart Kit v2 Developer Preview
19
+ <p>
20
+ <a href="https://chartkit.io/">Website</a>
21
+ ·
22
+ <a href="https://chartkit.io/docs/react-native/">Docs</a>
23
+ ·
24
+ <a href="https://chartkit.io/docs/react-native/getting-started/installation/">Quickstart</a>
25
+ ·
26
+ <a href="https://chartkit.io/docs/react-native/charts/pricing/">Pro</a>
27
+ </p>
28
+ </div>
10
29
 
11
- This repository now contains the Chart Kit v2 Developer Preview. Existing
12
- `react-native-chart-kit` users remain on the stable v6 line unless they install
13
- the `next` dist-tag. The root package keeps the legacy-compatible component
14
- surface, while new adopters can review the modern API in `@chart-kit/react-native`.
30
+ ## Install
15
31
 
16
- Current v2 docs:
17
-
18
- - [Developer Preview docs](docs/README.md)
19
- - [Installation](docs/getting-started/installation.md)
20
- - [Migration from v1](docs/migration/from-v1.md)
21
- - [Production recipes](docs/recipes/README.md)
22
-
23
- The legacy compatibility API remains documented below.
24
-
25
- ## Import components
26
-
27
- 1. `yarn add react-native-chart-kit`
28
- 2. `yarn add react-native-svg` install peer dependencies
29
- 3. Use with ES6 syntax to import components
30
-
31
- ```js
32
- import {
33
- LineChart,
34
- BarChart,
35
- PieChart,
36
- ProgressChart,
37
- ContributionGraph,
38
- StackedBarChart
39
- } from "react-native-chart-kit";
40
- ```
41
-
42
- ## Quick Example
43
-
44
- ```jsx
45
- <View>
46
- <Text>Bezier Line Chart</Text>
47
- <LineChart
48
- data={{
49
- labels: ["January", "February", "March", "April", "May", "June"],
50
- datasets: [
51
- {
52
- data: [
53
- Math.random() * 100,
54
- Math.random() * 100,
55
- Math.random() * 100,
56
- Math.random() * 100,
57
- Math.random() * 100,
58
- Math.random() * 100
59
- ]
60
- }
61
- ]
62
- }}
63
- width={Dimensions.get("window").width} // from react-native
64
- height={220}
65
- yAxisLabel="$"
66
- yAxisSuffix="k"
67
- yAxisInterval={1} // optional, defaults to 1
68
- chartConfig={{
69
- backgroundColor: "#e26a00",
70
- backgroundGradientFrom: "#fb8c00",
71
- backgroundGradientTo: "#ffa726",
72
- decimalPlaces: 2, // optional, defaults to 2dp
73
- color: (opacity = 1) => `rgba(255, 255, 255, ${opacity})`,
74
- labelColor: (opacity = 1) => `rgba(255, 255, 255, ${opacity})`,
75
- style: {
76
- borderRadius: 16
77
- },
78
- propsForDots: {
79
- r: "6",
80
- strokeWidth: "2",
81
- stroke: "#ffa726"
82
- }
83
- }}
84
- bezier
85
- style={{
86
- marginVertical: 8,
87
- borderRadius: 16
88
- }}
89
- />
90
- </View>
91
- ```
92
-
93
- ## Chart style object
94
-
95
- Define a chart style object with following properies as such:
96
-
97
- ```js
98
- const chartConfig = {
99
- backgroundGradientFrom: "#1E2923",
100
- backgroundGradientFromOpacity: 0,
101
- backgroundGradientTo: "#08130D",
102
- backgroundGradientToOpacity: 0.5,
103
- color: (opacity = 1) => `rgba(26, 255, 146, ${opacity})`,
104
- strokeWidth: 2, // optional, default 3
105
- barPercentage: 0.5,
106
- useShadowColorFromDataset: false // optional
107
- };
108
- ```
109
-
110
- | Property | Type | Description |
111
- | ----------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
112
- | backgroundGradientFrom | string | Defines the first color in the linear gradient of a chart's background |
113
- | backgroundGradientFromOpacity | Number | Defines the first color opacity in the linear gradient of a chart's background |
114
- | backgroundGradientTo | string | Defines the second color in the linear gradient of a chart's background |
115
- | backgroundGradientToOpacity | Number | Defines the second color opacity in the linear gradient of a chart's background |
116
- | fillShadowGradientFrom | string | Defines the first color in the linear gradient of the area under data (can also be specified as `fillShadowGradient`) |
117
- | fillShadowGradientFromOpacity | Number | Defines the first color opacity in the linear gradient of the area under data (can also be specified as `fillShadowGradientOpacity`) |
118
- | fillShadowGradientFromOffset | Number | Defines the first color offset (0-1) in the linear gradient of the area under data |
119
- | fillShadowGradientTo | string | Defines the second color in the linear gradient of the area under data |
120
- | fillShadowGradientToOpacity | Number | Defines the second color opacity in the linear gradient of the area under data |
121
- | fillShadowGradientToOffset | Number | Defines the second color offset (0-1) in the linear gradient of the area under data |
122
- | useShadowColorFromDataset | Boolean | Defines the option to use color from dataset to each chart data. Default is false |
123
- | color | function => string | Defines the base color function that is used to calculate colors of labels and sectors used in a chart |
124
- | strokeWidth | Number | Defines the base stroke width in a chart |
125
- | barPercentage | Number | Defines the percent (0-1) of the available width each bar width in a chart |
126
- | barRadius | Number | Defines the radius of each bar |
127
- | propsForBackgroundLines | props | Override styles of the background lines, refer to react-native-svg's Line documentation |
128
- | propsForLabels | props | Override styles of the labels, refer to react-native-svg's Text documentation |
129
- | propsForVerticalLabels | props | Override styles of vertical labels, refer to react-native-svg's Text documentation |
130
- | propsForHorizontalLabels | props | Override styles of horizontal labels, refer to react-native-svg's Text documentation |
131
-
132
- ## Responsive charts
133
-
134
- To render a responsive chart, use `Dimensions` react-native library to get the width of the screen of your device like such
135
-
136
- ```js
137
- import { Dimensions } from "react-native";
138
- const screenWidth = Dimensions.get("window").width;
32
+ ```sh
33
+ npm install react-native-chart-kit react-native-svg
139
34
  ```
140
35
 
141
- ## Line Chart
142
-
143
- ![Line Chart](https://i.imgur.com/Wt26snd.jpg)
144
-
145
- ```js
146
- const data = {
147
- labels: ["January", "February", "March", "April", "May", "June"],
148
- datasets: [
149
- {
150
- data: [20, 45, 28, 80, 99, 43],
151
- color: (opacity = 1) => `rgba(134, 65, 244, ${opacity})`, // optional
152
- strokeWidth: 2 // optional
153
- }
154
- ],
155
- legend: ["Rainy Days"] // optional
156
- };
157
- ```
158
-
159
- ```jsx
160
- <LineChart
161
- data={data}
162
- width={screenWidth}
163
- height={220}
164
- chartConfig={chartConfig}
165
- />
166
- ```
167
-
168
- | Property | Type | Description |
169
- | ----------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
170
- | data | Object | Data for the chart - see example above |
171
- | width | Number | Width of the chart, use 'Dimensions' library to get the width of your screen for responsive |
172
- | height | Number | Height of the chart |
173
- | withDots | boolean | Show dots on the line - default: True |
174
- | withShadow | boolean | Show shadow for line - default: True |
175
- | withInnerLines | boolean | Show inner dashed lines - default: True |
176
- | withOuterLines | boolean | Show outer dashed lines - default: True |
177
- | withVerticalLines | boolean | Show vertical lines - default: True |
178
- | withHorizontalLines | boolean | Show horizontal lines - default: True |
179
- | withVerticalLabels | boolean | Show vertical labels - default: True |
180
- | withHorizontalLabels | boolean | Show horizontal labels - default: True |
181
- | fromZero | boolean | Render charts from 0 not from the minimum value. - default: False |
182
- | yAxisLabel | string | Prepend text to horizontal labels -- default: '' |
183
- | yAxisSuffix | string | Append text to horizontal labels -- default: '' |
184
- | xAxisLabel | string | Prepend text to vertical labels -- default: '' |
185
- | yAxisInterval | string | Display y axis line every {x} input. -- default: 1 |
186
- | chartConfig | Object | Configuration object for the chart, see example config object above |
187
- | decorator | Function | This function takes a [whole bunch](https://github.com/indiespirit/react-native-chart-kit/blob/master/src/charts/line/LineChart.tsx) of stuff and can render extra elements, such as data point info or additional markup. |
188
- | onDataPointClick | Function | Callback that takes `{value, dataset, getColor}` |
189
- | horizontalLabelRotation | number (degree) | Rotation angle of the horizontal labels - default 0 |
190
- | verticalLabelRotation | number (degree) | Rotation angle of the vertical labels - default 0 |
191
- | getDotColor | function => string | Defines the dot color function that is used to calculate colors of dots in a line chart and takes `(dataPoint, dataPointIndex)` |
192
- | renderDotContent | Function | Render additional content for the dot. Takes `({x, y, index, indexData})` as arguments. |
193
- | yLabelsOffset | number | Offset for Y axis labels |
194
- | xLabelsOffset | number | Offset for X axis labels |
195
- | hidePointsAtIndex | number[] | Indices of the data points you don't want to display |
196
- | formatYLabel | Function | This function change the format of the display value of the Y label. Takes the Y value as argument and should return the desirable string. |
197
- | formatXLabel | Function | This function change the format of the display value of the X label. Takes the X value as argument and should return the desirable string. |
198
- | getDotProps | (value, index) => props | This is an alternative to chartConfig's propsForDots |
199
- | segments | number | The amount of horizontal lines - default 4 |
200
-
201
- ## Bezier Line Chart
202
-
203
- ![Line Chart](https://i.imgur.com/EnUiZZU.jpg)
204
-
205
- ```jsx
206
- <LineChart
207
- data={data}
208
- width={screenWidth}
209
- height={256}
210
- verticalLabelRotation={30}
211
- chartConfig={chartConfig}
212
- bezier
213
- />
214
- ```
215
-
216
- | Property | Type | Description |
217
- | -------- | ------- | ----------------------------------------------------- |
218
- | bezier | boolean | Add this prop to make the line chart smooth and curvy |
219
-
220
- ## Progress Ring
221
-
222
- ![Progress Chart](https://i.imgur.com/U4lkW0K.jpg)
223
-
224
- ```js
225
- // each value represents a goal ring in Progress chart
226
- const data = {
227
- labels: ["Swim", "Bike", "Run"], // optional
228
- data: [0.4, 0.6, 0.8]
229
- };
230
- ```
231
-
232
- ```jsx
233
- <ProgressChart
234
- data={data}
235
- width={screenWidth}
236
- height={220}
237
- strokeWidth={16}
238
- radius={32}
239
- chartConfig={chartConfig}
240
- hideLegend={false}
241
- />
242
- ```
243
-
244
- | Property | Type | Description |
245
- | ----------- | ------- | ------------------------------------------------------------------------------------------- |
246
- | data | Object | Data for the chart - see example above |
247
- | width | Number | Width of the chart, use 'Dimensions' library to get the width of your screen for responsive |
248
- | height | Number | Height of the chart |
249
- | strokeWidth | Number | Width of the stroke of the chart - default: 16 |
250
- | radius | Number | Inner radius of the chart - default: 32 |
251
- | chartConfig | Object | Configuration object for the chart, see example config in the beginning of this file |
252
- | hideLegend | Boolean | Switch to hide chart legend (defaults to false) |
253
-
254
- ## Bar chart
255
-
256
- ![Bat Chart](https://i.imgur.com/jVHEWiI.jpg)
257
-
258
- ```js
259
- const data = {
260
- labels: ["January", "February", "March", "April", "May", "June"],
261
- datasets: [
262
- {
263
- data: [20, 45, 28, 80, 99, 43]
264
- }
265
- ]
266
- };
267
- ```
268
-
269
- ```jsx
270
- <BarChart
271
- style={graphStyle}
272
- data={data}
273
- width={screenWidth}
274
- height={220}
275
- yAxisLabel="$"
276
- chartConfig={chartConfig}
277
- verticalLabelRotation={30}
278
- />
279
- ```
280
-
281
- | Property | Type | Description |
282
- | ----------------------- | --------------- | ------------------------------------------------------------------------------------------- |
283
- | data | Object | Data for the chart - see example above |
284
- | width | Number | Width of the chart, use 'Dimensions' library to get the width of your screen for responsive |
285
- | height | Number | Height of the chart |
286
- | withVerticalLabels | boolean | Show vertical labels - default: True |
287
- | withHorizontalLabels | boolean | Show horizontal labels - default: True |
288
- | fromZero | boolean | Render charts from 0 not from the minimum value. - default: False |
289
- | withInnerLines | boolean | Show inner dashed lines - default: True |
290
- | yAxisLabel | string | Prepend text to horizontal labels -- default: '' |
291
- | yAxisSuffix | string | Append text to horizontal labels -- default: '' |
292
- | chartConfig | Object | Configuration object for the chart, see example config in the beginning of this file |
293
- | horizontalLabelRotation | number (degree) | Rotation angle of the horizontal labels - default 0 |
294
- | verticalLabelRotation | number (degree) | Rotation angle of the vertical labels - default 0 |
295
- | showBarTops | boolean | Show bar tops |
296
- | showValuesOnTopOfBars | boolean | Show value above bars |
297
-
298
- ## StackedBar chart
36
+ Expo:
299
37
 
300
- ![StackedBar_Chart](https://imgur.com/JkBtxt8.jpg)
301
-
302
- ```js
303
- const data = {
304
- labels: ["Test1", "Test2"],
305
- legend: ["L1", "L2", "L3"],
306
- data: [
307
- [60, 60, 60],
308
- [30, 30, 60]
309
- ],
310
- barColors: ["#dfe4ea", "#ced6e0", "#a4b0be"]
311
- };
312
- ```
313
-
314
- ```jsx
315
- <StackedBarChart
316
- style={graphStyle}
317
- data={data}
318
- width={screenWidth}
319
- height={220}
320
- chartConfig={chartConfig}
321
- />
38
+ ```sh
39
+ npm install react-native-chart-kit
40
+ npx expo install react-native-svg
322
41
  ```
323
42
 
324
- | Property | Type | Description |
325
- | -------------------- | ------- | ------------------------------------------------------------------------------------------- |
326
- | data | Object | Data for the chart - see example above |
327
- | width | Number | Width of the chart, use 'Dimensions' library to get the width of your screen for responsive |
328
- | height | Number | Height of the chart |
329
- | withVerticalLabels | boolean | Show vertical labels - default: True |
330
- | withHorizontalLabels | boolean | Show horizontal labels - default: True |
331
- | chartConfig | Object | Configuration object for the chart, see example config in the beginning of this file |
332
- | barPercentage | Number | Defines the percent (0-1) of the available width each bar width in a chart |
333
- | showLegend | boolean | Show legend - default: True |
334
-
335
- ## Pie chart
336
-
337
- ![Pie Chart](https://i.imgur.com/JMz3obk.jpg)
338
-
339
- ### Modified Pie Chart Screenshot
43
+ ## First Chart
340
44
 
341
- ![Pie Chart_modified](/promo/piechart-modified.png)
45
+ ```tsx
46
+ import { LineChart } from "react-native-chart-kit/v2";
342
47
 
343
- ```js
344
48
  const data = [
345
- {
346
- name: "Seoul",
347
- population: 21500000,
348
- color: "rgba(131, 167, 234, 1)",
349
- legendFontColor: "#7F7F7F",
350
- legendFontSize: 15
351
- },
352
- {
353
- name: "Toronto",
354
- population: 2800000,
355
- color: "#F00",
356
- legendFontColor: "#7F7F7F",
357
- legendFontSize: 15
358
- },
359
- {
360
- name: "Beijing",
361
- population: 527612,
362
- color: "red",
363
- legendFontColor: "#7F7F7F",
364
- legendFontSize: 15
365
- },
366
- {
367
- name: "New York",
368
- population: 8538000,
369
- color: "#ffffff",
370
- legendFontColor: "#7F7F7F",
371
- legendFontSize: 15
372
- },
373
- {
374
- name: "Moscow",
375
- population: 11920000,
376
- color: "rgb(0, 0, 255)",
377
- legendFontColor: "#7F7F7F",
378
- legendFontSize: 15
379
- }
380
- ];
381
- ```
382
-
383
- ```jsx
384
- <PieChart
385
- data={data}
386
- width={screenWidth}
387
- height={220}
388
- chartConfig={chartConfig}
389
- accessor={"population"}
390
- backgroundColor={"transparent"}
391
- paddingLeft={"15"}
392
- center={[10, 50]}
393
- absolute
394
- />
395
- ```
396
-
397
- | Property | Type | Description |
398
- | -------------- | ------- | ------------------------------------------------------------------------------------------------- |
399
- | data | Object | Data for the chart - see example above |
400
- | width | Number | Width of the chart, use 'Dimensions' library to get the width of your screen for responsive |
401
- | height | Number | Height of the chart |
402
- | chartConfig | Object | Configuration object for the chart, see example config in the beginning of this file |
403
- | accessor | string | Property in the `data` object from which the number values are taken |
404
- | bgColor | string | background color - if you want to set transparent, input `transparent` or `none`. |
405
- | paddingLeft | string | left padding of the pie chart |
406
- | center | array | offset x and y coordinates to position the chart |
407
- | absolute | boolean | shows the values as absolute numbers |
408
- | hasLegend | boolean | Defaults to `true`, set it to `false` to remove the legend |
409
- | avoidFalseZero | boolean | Defaults to `false`, set it to `true` to display a "<1%" instead of a rounded value equal to "0%" |
410
-
411
- ## Contribution graph (heatmap)
412
-
413
- ![Contribution Graph](https://i.imgur.com/NKURRt6.jpg)
414
-
415
- This type of graph is often use to display a developer contribution activity. However, there many other use cases this graph is used when you need to visualize a frequency of a certain event over time.
416
-
417
- ```js
418
- const commitsData = [
419
- { date: "2017-01-02", count: 1 },
420
- { date: "2017-01-03", count: 2 },
421
- { date: "2017-01-04", count: 3 },
422
- { date: "2017-01-05", count: 4 },
423
- { date: "2017-01-06", count: 5 },
424
- { date: "2017-01-30", count: 2 },
425
- { date: "2017-01-31", count: 3 },
426
- { date: "2017-03-01", count: 2 },
427
- { date: "2017-04-02", count: 4 },
428
- { date: "2017-03-05", count: 2 },
429
- { date: "2017-02-30", count: 4 }
49
+ { month: "Jan", revenue: 52 },
50
+ { month: "Feb", revenue: 86 },
51
+ { month: "Mar", revenue: 58 },
52
+ { month: "Apr", revenue: 134 }
430
53
  ];
431
- ```
432
-
433
- ```jsx
434
- <ContributionGraph
435
- values={commitsData}
436
- endDate={new Date("2017-04-01")}
437
- numDays={105}
438
- width={screenWidth}
439
- height={220}
440
- chartConfig={chartConfig}
441
- />
442
- ```
443
-
444
- | Property | Type | Description |
445
- | ------------------ | -------- | ------------------------------------------------------------------------------------------- |
446
- | data | Object | Data for the chart - see example above |
447
- | width | Number | Width of the chart, use 'Dimensions' library to get the width of your screen for responsive |
448
- | height | Number | Height of the chart |
449
- | gutterSize | Number | Size of the gutters between the squares in the chart |
450
- | squareSize | Number | Size of the squares in the chart |
451
- | horizontal | boolean | Should graph be laid out horizontally? Defaults to `true` |
452
- | showMonthLabels | boolean | Should graph include labels for the months? Defaults to `true` |
453
- | showOutOfRangeDays | boolean | Should graph be filled with squares, including days outside the range? Defaults to `false` |
454
- | chartConfig | Object | Configuration object for the chart, see example config in the beginning of this file |
455
- | accessor | string | Property in the `data` object from which the number values are taken; defaults to `count` |
456
- | getMonthLabel | function | Function which returns the label for each month, taking month index (0 - 11) as argument |
457
- | onDayPress | function | Callback invoked when the user clicks a day square on the chart; takes a value-item object |
458
-
459
- ## More styling
460
-
461
- Every charts also accepts `style` props, which will be applied to parent `svg` or `View` component of each chart.
462
-
463
- ## Abstract Chart
464
54
 
465
- `src/abstract-chart.js` is an extendable class which can be used to create your own charts!
466
-
467
- The following methods are available:
468
-
469
- ### renderHorizontalLines(config)
470
-
471
- Renders background horizontal lines like in the Line Chart and Bar Chart. Takes a config object with following properties:
472
-
473
- ```js
474
- {
475
- // width of your chart
476
- width: Number,
477
- // height of your chart
478
- height: Number,
479
- // how many lines to render
480
- count: Number,
481
- // top padding from the chart top edge
482
- paddingTop: Number
55
+ export function RevenueChart() {
56
+ return (
57
+ <LineChart
58
+ data={data}
59
+ xKey="month"
60
+ yKey="revenue"
61
+ width={410}
62
+ height={240}
63
+ />
64
+ );
483
65
  }
484
66
  ```
485
67
 
486
- ### renderVerticalLabels(config)
487
-
488
- Render background vertical lines. Takes a config object with following properties:
489
-
490
- ```js
491
- {
492
- // data needed to calculate the number of lines to render
493
- data: Array,
494
- // width of your chart
495
- width: Number,
496
- // height of your chart
497
- height: Number,
498
- paddingTop: Number,
499
- paddingRight: Number
500
- }
501
- ```
502
-
503
- ### renderDefs(config)
504
-
505
- Render definitions of background and shadow gradients
506
-
507
- ```js
508
- {
509
- // width of your chart
510
- width: Number,
511
- // height of your chart
512
- height: Number,
513
- // first color of background gradient
514
- backgroundGradientFrom: String,
515
- // first color opacity of background gradient (0 - 1.0)
516
- backgroundGradientFromOpacity: Number,
517
- // second color of background gradient
518
- backgroundGradientTo: String,
519
- // second color opacity of background gradient (0 - 1.0)
520
- backgroundGradientToOpacity: Number,
521
- }
522
- ```
523
-
524
- ## Compilation
525
-
526
- For production use, the package is automatically compiled after installation, so that you can just install it with `npm` and use it out-of-the-box.
527
-
528
- To transpile TypeScript into JavaScript for development purposes, you can use either run `npm run build` to compile once, or `npm run dev` to start compilation in watch mode, which will recompile the files on change.
529
-
530
- ## More information
531
-
532
- This library is built on top of the following open-source projects:
533
-
534
- - react-native-svg (https://github.com/react-native-community/react-native-svg)
535
- - paths-js (https://github.com/andreaferretti/paths-js)
536
- - react-native-calendar-heatmap (https://github.com/ayooby/react-native-calendar-heatmap)
537
-
538
- ## Contribute
539
-
540
- See the [contribution guide](contributing.md) and join [the contributors](https://github.com/indiespirit/react-native-chart-kit/graphs/contributors)!
68
+ The root import stays available for legacy screens. New screens should use
69
+ `react-native-chart-kit/v2`.
70
+
71
+ ## What You Get
72
+
73
+ - Modern public charts:
74
+ [line](https://chartkit.io/docs/react-native/charts/line/),
75
+ [area](https://chartkit.io/docs/react-native/charts/area/),
76
+ [bar](https://chartkit.io/docs/react-native/charts/bar/),
77
+ [pie](https://chartkit.io/docs/react-native/charts/pie/),
78
+ [donut](https://chartkit.io/docs/react-native/charts/donut/),
79
+ [progress](https://chartkit.io/docs/react-native/charts/progress/), and
80
+ [contribution heatmap](https://chartkit.io/docs/react-native/charts/contribution-heatmap/).
81
+ - Mobile interactions:
82
+ [tap selection, shared tooltips, and crosshairs](https://chartkit.io/docs/react-native/charts/line/#tooltips-and-selection).
83
+ - Shared
84
+ [themes](https://chartkit.io/docs/react-native/charts/themes/) and SVG
85
+ renderer defaults.
86
+ - Migration help for existing apps:
87
+ [from v1](https://chartkit.io/docs/react-native/migration/from-v1/) and
88
+ [prop mapping](https://chartkit.io/docs/react-native/migration/prop-mapping/).
89
+
90
+ ## Pro Charts
91
+
92
+ Chart Kit Pro adds licensed chart workflows for product dashboards:
93
+
94
+ - [Candlebar](https://chartkit.io/docs/react-native/charts/candlebar/),
95
+ [radar](https://chartkit.io/docs/react-native/charts/radar/),
96
+ [realtime bar](https://chartkit.io/docs/react-native/charts/realtime/), and
97
+ [combo charts](https://chartkit.io/docs/react-native/charts/combo/).
98
+ - [PNG and SVG export APIs](https://chartkit.io/docs/react-native/charts/export/)
99
+ for reports, sharing, and background rendering.
100
+ - [Install Pro](https://chartkit.io/docs/react-native/charts/pro-installation/) or
101
+ compare [pricing](https://chartkit.io/docs/react-native/charts/pricing/).
102
+
103
+ ## Links
104
+
105
+ - [Full documentation](https://chartkit.io/docs/react-native/)
106
+ - [Troubleshooting](https://chartkit.io/docs/react-native/troubleshooting/)
107
+ - [Contributing](https://chartkit.io/docs/react-native/getting-started/contributing/)
108
+ - [llms.txt](https://chartkit.io/llms.txt)
@@ -9,7 +9,7 @@ export interface LineChartProps extends AbstractChartProps {
9
9
  /**
10
10
  * Data for the chart.
11
11
  *
12
- * Example from [docs](https://github.com/indiespirit/react-native-chart-kit#line-chart):
12
+ * Example from [docs](https://github.com/chart-kit/react-native-chart-kit#line-chart):
13
13
  *
14
14
  * ```javascript
15
15
  * const data = {
@@ -107,7 +107,7 @@ export interface LineChartProps extends AbstractChartProps {
107
107
  */
108
108
  transparent?: boolean;
109
109
  /**
110
- * This function takes a [whole bunch](https://github.com/indiespirit/react-native-chart-kit/blob/master/src/charts/line/LineChart.tsx)
110
+ * This function takes a [whole bunch](https://github.com/chart-kit/react-native-chart-kit/blob/master/src/charts/line/LineChart.tsx)
111
111
  * of stuff and can render extra elements,
112
112
  * such as data point info or additional markup.
113
113
  */
@@ -130,7 +130,7 @@ export interface LineChartProps extends AbstractChartProps {
130
130
  /**
131
131
  * Add this prop to make the line chart smooth and curvy.
132
132
  *
133
- * [Example](https://github.com/indiespirit/react-native-chart-kit#bezier-line-chart)
133
+ * [Example](https://github.com/chart-kit/react-native-chart-kit#bezier-line-chart)
134
134
  */
135
135
  bezier?: boolean;
136
136
  /**