@coinbase/cds-mcp-server 8.17.2 → 8.17.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 (269) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/mcp-docs/mobile/components/Accordion.txt +189 -0
  3. package/mcp-docs/mobile/components/AccordionItem.txt +30 -0
  4. package/mcp-docs/mobile/components/Alert.txt +156 -0
  5. package/mcp-docs/mobile/components/AreaChart.txt +266 -0
  6. package/mcp-docs/mobile/components/Avatar.txt +196 -0
  7. package/mcp-docs/mobile/components/AvatarButton.txt +226 -0
  8. package/mcp-docs/mobile/components/Banner.txt +222 -0
  9. package/mcp-docs/mobile/components/BarChart.txt +816 -0
  10. package/mcp-docs/mobile/components/Box.txt +174 -0
  11. package/mcp-docs/mobile/components/BrowserBar.txt +147 -0
  12. package/mcp-docs/mobile/components/Button.txt +199 -0
  13. package/mcp-docs/mobile/components/ButtonGroup.txt +80 -0
  14. package/mcp-docs/mobile/components/Carousel.txt +1084 -0
  15. package/mcp-docs/mobile/components/CartesianChart.txt +826 -0
  16. package/mcp-docs/mobile/components/CellMedia.txt +71 -0
  17. package/mcp-docs/mobile/components/Checkbox.txt +246 -0
  18. package/mcp-docs/mobile/components/CheckboxCell.txt +202 -0
  19. package/mcp-docs/mobile/components/CheckboxGroup.txt +285 -0
  20. package/mcp-docs/mobile/components/Chip.txt +195 -0
  21. package/mcp-docs/mobile/components/Coachmark.txt +158 -0
  22. package/mcp-docs/mobile/components/Collapsible.txt +105 -0
  23. package/mcp-docs/mobile/components/ContainedAssetCard.txt +135 -0
  24. package/mcp-docs/mobile/components/ContentCard.txt +366 -0
  25. package/mcp-docs/mobile/components/ContentCardBody.txt +136 -0
  26. package/mcp-docs/mobile/components/ContentCardFooter.txt +128 -0
  27. package/mcp-docs/mobile/components/ContentCardHeader.txt +146 -0
  28. package/mcp-docs/mobile/components/ContentCell.txt +227 -0
  29. package/mcp-docs/mobile/components/ControlGroup.txt +444 -0
  30. package/mcp-docs/mobile/components/DatePicker.txt +497 -0
  31. package/mcp-docs/mobile/components/Divider.txt +139 -0
  32. package/mcp-docs/mobile/components/DotCount.txt +146 -0
  33. package/mcp-docs/mobile/components/DotStatusColor.txt +59 -0
  34. package/mcp-docs/mobile/components/DotSymbol.txt +135 -0
  35. package/mcp-docs/mobile/components/Fallback.txt +158 -0
  36. package/mcp-docs/mobile/components/FloatingAssetCard.txt +156 -0
  37. package/mcp-docs/mobile/components/HStack.txt +235 -0
  38. package/mcp-docs/mobile/components/HeroSquare.txt +48 -0
  39. package/mcp-docs/mobile/components/Icon.txt +52 -0
  40. package/mcp-docs/mobile/components/IconButton.txt +269 -0
  41. package/mcp-docs/mobile/components/InputChip.txt +188 -0
  42. package/mcp-docs/mobile/components/Interactable.txt +187 -0
  43. package/mcp-docs/mobile/components/LineChart.txt +1325 -0
  44. package/mcp-docs/mobile/components/Link.txt +292 -0
  45. package/mcp-docs/mobile/components/ListCell.txt +391 -0
  46. package/mcp-docs/mobile/components/LogoMark.txt +85 -0
  47. package/mcp-docs/mobile/components/LogoWordMark.txt +94 -0
  48. package/mcp-docs/mobile/components/Lottie.txt +139 -0
  49. package/mcp-docs/mobile/components/LottieStatusAnimation.txt +47 -0
  50. package/mcp-docs/mobile/components/Modal.txt +84 -0
  51. package/mcp-docs/mobile/components/ModalBody.txt +34 -0
  52. package/mcp-docs/mobile/components/ModalFooter.txt +25 -0
  53. package/mcp-docs/mobile/components/ModalHeader.txt +28 -0
  54. package/mcp-docs/mobile/components/MultiContentModule.txt +380 -0
  55. package/mcp-docs/mobile/components/NavigationTitle.txt +132 -0
  56. package/mcp-docs/mobile/components/NavigationTitleSelect.txt +142 -0
  57. package/mcp-docs/mobile/components/NudgeCard.txt +90 -0
  58. package/mcp-docs/mobile/components/Numpad.txt +341 -0
  59. package/mcp-docs/mobile/components/Overlay.txt +152 -0
  60. package/mcp-docs/mobile/components/PageFooter.txt +161 -0
  61. package/mcp-docs/mobile/components/PageHeader.txt +186 -0
  62. package/mcp-docs/mobile/components/PeriodSelector.txt +408 -0
  63. package/mcp-docs/mobile/components/Pictogram.txt +48 -0
  64. package/mcp-docs/mobile/components/Point.txt +205 -0
  65. package/mcp-docs/mobile/components/PortalProvider.txt +79 -0
  66. package/mcp-docs/mobile/components/Pressable.txt +211 -0
  67. package/mcp-docs/mobile/components/ProgressBar.txt +130 -0
  68. package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +161 -0
  69. package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +138 -0
  70. package/mcp-docs/mobile/components/ProgressCircle.txt +237 -0
  71. package/mcp-docs/mobile/components/Radio.txt +242 -0
  72. package/mcp-docs/mobile/components/RadioCell.txt +202 -0
  73. package/mcp-docs/mobile/components/RadioGroup.txt +282 -0
  74. package/mcp-docs/mobile/components/ReferenceLine.txt +153 -0
  75. package/mcp-docs/mobile/components/RemoteImage.txt +106 -0
  76. package/mcp-docs/mobile/components/RemoteImageGroup.txt +61 -0
  77. package/mcp-docs/mobile/components/RollingNumber.txt +789 -0
  78. package/mcp-docs/mobile/components/Scrubber.txt +204 -0
  79. package/mcp-docs/mobile/components/SearchInput.txt +192 -0
  80. package/mcp-docs/mobile/components/SectionHeader.txt +205 -0
  81. package/mcp-docs/mobile/components/SegmentedTabs.txt +316 -0
  82. package/mcp-docs/mobile/components/Select.txt +212 -0
  83. package/mcp-docs/mobile/components/SelectChip.txt +324 -0
  84. package/mcp-docs/mobile/components/SelectOption.txt +85 -0
  85. package/mcp-docs/mobile/components/SlideButton.txt +331 -0
  86. package/mcp-docs/mobile/components/Spacer.txt +84 -0
  87. package/mcp-docs/mobile/components/Sparkline.txt +123 -0
  88. package/mcp-docs/mobile/components/SparklineGradient.txt +107 -0
  89. package/mcp-docs/mobile/components/SparklineInteractive.txt +157 -0
  90. package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +73 -0
  91. package/mcp-docs/mobile/components/Spinner.txt +49 -0
  92. package/mcp-docs/mobile/components/SpotIcon.txt +48 -0
  93. package/mcp-docs/mobile/components/SpotRectangle.txt +48 -0
  94. package/mcp-docs/mobile/components/SpotSquare.txt +48 -0
  95. package/mcp-docs/mobile/components/Stepper.txt +528 -0
  96. package/mcp-docs/mobile/components/SubBrandLogoMark.txt +126 -0
  97. package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +126 -0
  98. package/mcp-docs/mobile/components/Switch.txt +98 -0
  99. package/mcp-docs/mobile/components/TabIndicator.txt +49 -0
  100. package/mcp-docs/mobile/components/TabLabel.txt +154 -0
  101. package/mcp-docs/mobile/components/TabNavigation.txt +147 -0
  102. package/mcp-docs/mobile/components/TabbedChips.txt +143 -0
  103. package/mcp-docs/mobile/components/Tabs.txt +191 -0
  104. package/mcp-docs/mobile/components/Tag.txt +301 -0
  105. package/mcp-docs/mobile/components/Text.txt +212 -0
  106. package/mcp-docs/mobile/components/TextInput.txt +718 -0
  107. package/mcp-docs/mobile/components/ThemeProvider.txt +133 -0
  108. package/mcp-docs/mobile/components/Toast.txt +197 -0
  109. package/mcp-docs/mobile/components/Tooltip.txt +60 -0
  110. package/mcp-docs/mobile/components/TopNavBar.txt +162 -0
  111. package/mcp-docs/mobile/components/Tour.txt +159 -0
  112. package/mcp-docs/mobile/components/Tray.txt +253 -0
  113. package/mcp-docs/mobile/components/UpsellCard.txt +322 -0
  114. package/mcp-docs/mobile/components/VStack.txt +223 -0
  115. package/mcp-docs/mobile/components/XAxis.txt +622 -0
  116. package/mcp-docs/mobile/components/YAxis.txt +568 -0
  117. package/mcp-docs/mobile/getting-started/introduction.txt +99 -0
  118. package/mcp-docs/mobile/getting-started/mcp-server.txt +94 -0
  119. package/mcp-docs/mobile/getting-started/playground.txt +25 -0
  120. package/mcp-docs/mobile/hooks/useDimensions.txt +47 -0
  121. package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +215 -0
  122. package/mcp-docs/mobile/hooks/useTheme.txt +110 -0
  123. package/mcp-docs/mobile/routes.txt +132 -0
  124. package/mcp-docs/web/components/Accordion.txt +190 -0
  125. package/mcp-docs/web/components/AccordionItem.txt +32 -0
  126. package/mcp-docs/web/components/Alert.txt +165 -0
  127. package/mcp-docs/web/components/AreaChart.txt +511 -0
  128. package/mcp-docs/web/components/Avatar.txt +212 -0
  129. package/mcp-docs/web/components/AvatarButton.txt +241 -0
  130. package/mcp-docs/web/components/Banner.txt +227 -0
  131. package/mcp-docs/web/components/BarChart.txt +1268 -0
  132. package/mcp-docs/web/components/Box.txt +176 -0
  133. package/mcp-docs/web/components/Button.txt +213 -0
  134. package/mcp-docs/web/components/ButtonGroup.txt +80 -0
  135. package/mcp-docs/web/components/Calendar.txt +182 -0
  136. package/mcp-docs/web/components/Carousel.txt +1576 -0
  137. package/mcp-docs/web/components/CartesianChart.txt +1045 -0
  138. package/mcp-docs/web/components/CellMedia.txt +57 -0
  139. package/mcp-docs/web/components/Checkbox.txt +189 -0
  140. package/mcp-docs/web/components/CheckboxCell.txt +203 -0
  141. package/mcp-docs/web/components/CheckboxGroup.txt +220 -0
  142. package/mcp-docs/web/components/Chip.txt +197 -0
  143. package/mcp-docs/web/components/Coachmark.txt +189 -0
  144. package/mcp-docs/web/components/Collapsible.txt +120 -0
  145. package/mcp-docs/web/components/ContainedAssetCard.txt +233 -0
  146. package/mcp-docs/web/components/ContentCard.txt +368 -0
  147. package/mcp-docs/web/components/ContentCardBody.txt +138 -0
  148. package/mcp-docs/web/components/ContentCardFooter.txt +130 -0
  149. package/mcp-docs/web/components/ContentCardHeader.txt +148 -0
  150. package/mcp-docs/web/components/ContentCell.txt +220 -0
  151. package/mcp-docs/web/components/ControlGroup.txt +437 -0
  152. package/mcp-docs/web/components/DatePicker.txt +506 -0
  153. package/mcp-docs/web/components/Divider.txt +144 -0
  154. package/mcp-docs/web/components/DotCount.txt +150 -0
  155. package/mcp-docs/web/components/DotStatusColor.txt +59 -0
  156. package/mcp-docs/web/components/DotSymbol.txt +138 -0
  157. package/mcp-docs/web/components/Dropdown.txt +120 -0
  158. package/mcp-docs/web/components/Fallback.txt +164 -0
  159. package/mcp-docs/web/components/FloatingAssetCard.txt +251 -0
  160. package/mcp-docs/web/components/FullscreenAlert.txt +70 -0
  161. package/mcp-docs/web/components/FullscreenModal.txt +146 -0
  162. package/mcp-docs/web/components/FullscreenModalLayout.txt +188 -0
  163. package/mcp-docs/web/components/Grid.txt +237 -0
  164. package/mcp-docs/web/components/GridColumn.txt +210 -0
  165. package/mcp-docs/web/components/HStack.txt +237 -0
  166. package/mcp-docs/web/components/HeroSquare.txt +49 -0
  167. package/mcp-docs/web/components/Icon.txt +146 -0
  168. package/mcp-docs/web/components/IconButton.txt +391 -0
  169. package/mcp-docs/web/components/InputChip.txt +188 -0
  170. package/mcp-docs/web/components/Interactable.txt +194 -0
  171. package/mcp-docs/web/components/LineChart.txt +1577 -0
  172. package/mcp-docs/web/components/Link.txt +244 -0
  173. package/mcp-docs/web/components/ListCell.txt +397 -0
  174. package/mcp-docs/web/components/LogoMark.txt +85 -0
  175. package/mcp-docs/web/components/LogoWordMark.txt +94 -0
  176. package/mcp-docs/web/components/Lottie.txt +158 -0
  177. package/mcp-docs/web/components/LottieStatusAnimation.txt +58 -0
  178. package/mcp-docs/web/components/MediaQueryProvider.txt +109 -0
  179. package/mcp-docs/web/components/Modal.txt +193 -0
  180. package/mcp-docs/web/components/ModalBody.txt +118 -0
  181. package/mcp-docs/web/components/ModalFooter.txt +120 -0
  182. package/mcp-docs/web/components/ModalHeader.txt +124 -0
  183. package/mcp-docs/web/components/MultiContentModule.txt +382 -0
  184. package/mcp-docs/web/components/NavigationBar.txt +103 -0
  185. package/mcp-docs/web/components/NavigationTitle.txt +26 -0
  186. package/mcp-docs/web/components/NavigationTitleSelect.txt +46 -0
  187. package/mcp-docs/web/components/NudgeCard.txt +182 -0
  188. package/mcp-docs/web/components/Overlay.txt +172 -0
  189. package/mcp-docs/web/components/PageFooter.txt +185 -0
  190. package/mcp-docs/web/components/PageHeader.txt +244 -0
  191. package/mcp-docs/web/components/Pagination.txt +500 -0
  192. package/mcp-docs/web/components/PeriodSelector.txt +704 -0
  193. package/mcp-docs/web/components/Pictogram.txt +49 -0
  194. package/mcp-docs/web/components/Point.txt +461 -0
  195. package/mcp-docs/web/components/PortalProvider.txt +77 -0
  196. package/mcp-docs/web/components/Pressable.txt +194 -0
  197. package/mcp-docs/web/components/ProgressBar.txt +164 -0
  198. package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +213 -0
  199. package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +182 -0
  200. package/mcp-docs/web/components/ProgressCircle.txt +444 -0
  201. package/mcp-docs/web/components/Radio.txt +220 -0
  202. package/mcp-docs/web/components/RadioCell.txt +216 -0
  203. package/mcp-docs/web/components/RadioGroup.txt +289 -0
  204. package/mcp-docs/web/components/ReferenceLine.txt +452 -0
  205. package/mcp-docs/web/components/RemoteImage.txt +166 -0
  206. package/mcp-docs/web/components/RemoteImageGroup.txt +87 -0
  207. package/mcp-docs/web/components/RollingNumber.txt +1022 -0
  208. package/mcp-docs/web/components/Scrubber.txt +232 -0
  209. package/mcp-docs/web/components/SearchInput.txt +118 -0
  210. package/mcp-docs/web/components/SectionHeader.txt +218 -0
  211. package/mcp-docs/web/components/SegmentedTabs.txt +325 -0
  212. package/mcp-docs/web/components/Select.txt +225 -0
  213. package/mcp-docs/web/components/SelectChip.txt +315 -0
  214. package/mcp-docs/web/components/SelectOption.txt +166 -0
  215. package/mcp-docs/web/components/Sidebar.txt +350 -0
  216. package/mcp-docs/web/components/SidebarItem.txt +132 -0
  217. package/mcp-docs/web/components/SidebarMoreMenu.txt +31 -0
  218. package/mcp-docs/web/components/Spacer.txt +174 -0
  219. package/mcp-docs/web/components/Sparkline.txt +123 -0
  220. package/mcp-docs/web/components/SparklineGradient.txt +107 -0
  221. package/mcp-docs/web/components/SparklineInteractive.txt +154 -0
  222. package/mcp-docs/web/components/SparklineInteractiveHeader.txt +77 -0
  223. package/mcp-docs/web/components/Spinner.txt +129 -0
  224. package/mcp-docs/web/components/SpotIcon.txt +49 -0
  225. package/mcp-docs/web/components/SpotRectangle.txt +49 -0
  226. package/mcp-docs/web/components/SpotSquare.txt +49 -0
  227. package/mcp-docs/web/components/Stepper.txt +683 -0
  228. package/mcp-docs/web/components/SubBrandLogoMark.txt +126 -0
  229. package/mcp-docs/web/components/SubBrandLogoWordMark.txt +126 -0
  230. package/mcp-docs/web/components/Switch.txt +86 -0
  231. package/mcp-docs/web/components/TabIndicator.txt +49 -0
  232. package/mcp-docs/web/components/TabLabel.txt +159 -0
  233. package/mcp-docs/web/components/TabNavigation.txt +160 -0
  234. package/mcp-docs/web/components/TabbedChips.txt +156 -0
  235. package/mcp-docs/web/components/Table.txt +368 -0
  236. package/mcp-docs/web/components/TableBody.txt +84 -0
  237. package/mcp-docs/web/components/TableCaption.txt +103 -0
  238. package/mcp-docs/web/components/TableCell.txt +166 -0
  239. package/mcp-docs/web/components/TableCellFallback.txt +98 -0
  240. package/mcp-docs/web/components/TableFooter.txt +84 -0
  241. package/mcp-docs/web/components/TableHeader.txt +101 -0
  242. package/mcp-docs/web/components/TableRow.txt +141 -0
  243. package/mcp-docs/web/components/Tabs.txt +213 -0
  244. package/mcp-docs/web/components/Tag.txt +305 -0
  245. package/mcp-docs/web/components/Text.txt +233 -0
  246. package/mcp-docs/web/components/TextInput.txt +653 -0
  247. package/mcp-docs/web/components/ThemeProvider.txt +200 -0
  248. package/mcp-docs/web/components/TileButton.txt +159 -0
  249. package/mcp-docs/web/components/Toast.txt +204 -0
  250. package/mcp-docs/web/components/Tooltip.txt +90 -0
  251. package/mcp-docs/web/components/Tour.txt +180 -0
  252. package/mcp-docs/web/components/Tray.txt +289 -0
  253. package/mcp-docs/web/components/UpsellCard.txt +320 -0
  254. package/mcp-docs/web/components/VStack.txt +225 -0
  255. package/mcp-docs/web/components/XAxis.txt +620 -0
  256. package/mcp-docs/web/components/YAxis.txt +549 -0
  257. package/mcp-docs/web/getting-started/introduction.txt +99 -0
  258. package/mcp-docs/web/getting-started/mcp-server.txt +94 -0
  259. package/mcp-docs/web/getting-started/playground.txt +25 -0
  260. package/mcp-docs/web/hooks/useBreakpoints.txt +33 -0
  261. package/mcp-docs/web/hooks/useDimensions.txt +55 -0
  262. package/mcp-docs/web/hooks/useHasMounted.txt +55 -0
  263. package/mcp-docs/web/hooks/useIsoEffect.txt +42 -0
  264. package/mcp-docs/web/hooks/useMediaQuery.txt +94 -0
  265. package/mcp-docs/web/hooks/useOverlayContentContext.txt +217 -0
  266. package/mcp-docs/web/hooks/useScrollBlocker.txt +63 -0
  267. package/mcp-docs/web/hooks/useTheme.txt +105 -0
  268. package/mcp-docs/web/routes.txt +155 -0
  269. package/package.json +1 -1
@@ -0,0 +1,826 @@
1
+ # CartesianChart
2
+
3
+ A flexible, low-level chart component for displaying data in an x/y coordinate space. Provides a foundation for building custom chart visualizations with full control over rendering.
4
+
5
+ ## Import
6
+
7
+ ```jsx
8
+ import { CartesianChart } from '@coinbase/cds-mobile-visualization'
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Required | Default | Description |
14
+ | --- | --- | --- | --- | --- |
15
+ | `alignContent` | `flex-start \| flex-end \| center \| stretch \| space-between \| space-around \| space-evenly` | No | `-` | - |
16
+ | `alignItems` | `flex-start \| flex-end \| center \| stretch \| baseline` | No | `-` | - |
17
+ | `alignSelf` | `auto \| FlexAlignType` | No | `-` | - |
18
+ | `allowOverflowGestures` | `boolean` | No | `-` | Allows continuous gestures on the chart to continue outside the bounds of the chart element. |
19
+ | `animate` | `boolean` | No | `true` | Whether to animate the chart. |
20
+ | `animated` | `boolean` | No | `-` | - |
21
+ | `aspectRatio` | `string \| number` | No | `-` | - |
22
+ | `background` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
23
+ | `borderBottomLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
24
+ | `borderBottomRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
25
+ | `borderBottomWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
26
+ | `borderColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
27
+ | `borderEndWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
28
+ | `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
29
+ | `borderStartWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
30
+ | `borderTopLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
31
+ | `borderTopRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
32
+ | `borderTopWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
33
+ | `borderWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
34
+ | `bordered` | `boolean` | No | `-` | Add a border around all sides of the box. |
35
+ | `borderedBottom` | `boolean` | No | `-` | Add a border to the bottom side of the box. |
36
+ | `borderedEnd` | `boolean` | No | `-` | Add a border to the trailing side of the box. |
37
+ | `borderedHorizontal` | `boolean` | No | `-` | Add a border to the leading and trailing sides of the box. |
38
+ | `borderedStart` | `boolean` | No | `-` | Add a border to the leading side of the box. |
39
+ | `borderedTop` | `boolean` | No | `-` | Add a border to the top side of the box. |
40
+ | `borderedVertical` | `boolean` | No | `-` | Add a border to the top and bottom sides of the box. |
41
+ | `bottom` | `string \| number` | No | `-` | - |
42
+ | `color` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
43
+ | `columnGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
44
+ | `dangerouslySetBackground` | `string` | No | `-` | - |
45
+ | `display` | `flex \| none` | No | `-` | - |
46
+ | `elevation` | `0 \| 1 \| 2` | No | `-` | Determines box shadow styles. Parent should have overflow set to visible to ensure styles are not clipped. |
47
+ | `enableScrubbing` | `boolean` | No | `-` | Enables scrubbing interactions. When true, allows scrubbing and makes scrubber components interactive. |
48
+ | `flexBasis` | `string \| number` | No | `-` | - |
49
+ | `flexDirection` | `row \| column \| row-reverse \| column-reverse` | No | `-` | - |
50
+ | `flexGrow` | `number` | No | `-` | - |
51
+ | `flexShrink` | `number` | No | `-` | - |
52
+ | `flexWrap` | `wrap \| nowrap \| wrap-reverse` | No | `-` | - |
53
+ | `font` | `inherit \| FontFamily` | No | `-` | - |
54
+ | `fontFamily` | `inherit \| FontFamily` | No | `-` | - |
55
+ | `fontSize` | `inherit \| FontSize` | No | `-` | - |
56
+ | `fontWeight` | `inherit \| FontWeight` | No | `-` | - |
57
+ | `gap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
58
+ | `height` | `string \| number` | No | `-` | Chart height. If not provided, will use the containers measured height. |
59
+ | `inset` | `number \| Partial<ChartInset>` | No | `-` | Inset around the entire chart (outside the axes). |
60
+ | `justifyContent` | `flex-start \| flex-end \| center \| space-between \| space-around \| space-evenly` | No | `-` | - |
61
+ | `key` | `Key \| null` | No | `-` | - |
62
+ | `left` | `string \| number` | No | `-` | - |
63
+ | `lineHeight` | `inherit \| LineHeight` | No | `-` | - |
64
+ | `margin` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
65
+ | `marginBottom` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
66
+ | `marginEnd` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
67
+ | `marginStart` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
68
+ | `marginTop` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
69
+ | `marginX` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
70
+ | `marginY` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
71
+ | `maxHeight` | `string \| number` | No | `-` | - |
72
+ | `maxWidth` | `string \| number` | No | `-` | - |
73
+ | `minHeight` | `string \| number` | No | `-` | - |
74
+ | `minWidth` | `string \| number` | No | `-` | - |
75
+ | `onPointerCancel` | `((event: PointerEvent) => void)` | No | `-` | - |
76
+ | `onPointerCancelCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
77
+ | `onPointerDown` | `((event: PointerEvent) => void)` | No | `-` | - |
78
+ | `onPointerDownCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
79
+ | `onPointerEnter` | `((event: PointerEvent) => void)` | No | `-` | - |
80
+ | `onPointerEnterCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
81
+ | `onPointerLeave` | `((event: PointerEvent) => void)` | No | `-` | - |
82
+ | `onPointerLeaveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
83
+ | `onPointerMove` | `((event: PointerEvent) => void)` | No | `-` | - |
84
+ | `onPointerMoveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
85
+ | `onPointerUp` | `((event: PointerEvent) => void)` | No | `-` | - |
86
+ | `onPointerUpCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
87
+ | `onScrubberPositionChange` | `((index: number) => void) \| undefined` | No | `-` | Callback fired when the scrubber position changes. Receives the dataIndex of the scrubber or undefined when not scrubbing. |
88
+ | `opacity` | `number \| AnimatedNode` | No | `-` | - |
89
+ | `overflow` | `visible \| hidden \| scroll` | No | `-` | - |
90
+ | `padding` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
91
+ | `paddingBottom` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
92
+ | `paddingEnd` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
93
+ | `paddingStart` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
94
+ | `paddingTop` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
95
+ | `paddingX` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
96
+ | `paddingY` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
97
+ | `pin` | `top \| bottom \| left \| right \| all` | No | `-` | Direction in which to absolutely pin the box. |
98
+ | `position` | `absolute \| relative \| static \| fixed \| sticky` | No | `-` | - |
99
+ | `ref` | `((instance: View \| null) => void) \| RefObject<View> \| null` | No | `-` | - |
100
+ | `right` | `string \| number` | No | `-` | - |
101
+ | `rowGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
102
+ | `series` | `Series[]` | No | `-` | Configuration objects that define how to visualize the data. Each series contains its own data array. |
103
+ | `style` | `false \| RegisteredStyle<ViewStyle> \| Value \| AnimatedInterpolation<string \| number> \| WithAnimatedObject<ViewStyle> \| WithAnimatedArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>> \| readonly (Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>)[]> \| null` | No | `-` | - |
104
+ | `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Used to locate this view in end-to-end tests. |
105
+ | `textAlign` | `auto \| left \| right \| center \| justify` | No | `-` | - |
106
+ | `textDecorationLine` | `none \| underline \| line-through \| underline line-through` | No | `-` | - |
107
+ | `textDecorationStyle` | `solid \| dotted \| dashed \| double` | No | `-` | - |
108
+ | `textTransform` | `none \| capitalize \| uppercase \| lowercase` | No | `-` | - |
109
+ | `top` | `string \| number` | No | `-` | - |
110
+ | `transform` | `string \| (({ scaleX: AnimatableNumericValue; } & { scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ scaleY: AnimatableNumericValue; } & { scaleX?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ translateX: AnimatableNumericValue \| ${number}%; } & { scaleX?: undefined; scaleY?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ translateY: AnimatableNumericValue \| ${number}%; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ perspective: AnimatableNumericValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotate: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateX: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateY: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateZ: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ scale: AnimatableNumericValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ skewX: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ skewY: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; matrix?: undefined; }) \| ({ matrix: AnimatableNumericValue[]; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; }))[]` | No | `-` | - |
111
+ | `userSelect` | `auto \| none \| text \| contain \| all` | No | `-` | - |
112
+ | `width` | `string \| number` | No | `-` | Chart width. If not provided, will use the containers measured width. |
113
+ | `xAxis` | `Partial<Omit<AxisConfigProps, id>>` | No | `-` | Configuration for x-axis. |
114
+ | `yAxis` | `Partial<AxisConfigProps> \| Partial<AxisConfigProps>[]` | No | `-` | Configuration for y-axis(es). Can be a single config or array of configs. If array, first axis becomes default if no id is specified. |
115
+ | `zIndex` | `number` | No | `-` | - |
116
+
117
+
118
+ ## Examples
119
+
120
+ CartesianChart is a customizable, SVG based component that can be used to display a variety of data in a x/y coordinate space. The underlying logic is handled by D3.
121
+
122
+ ### Basic Example
123
+
124
+ [AreaChart](/components/graphs/AreaChart/), [BarChart](/components/graphs/BarChart/), and [LineChart](/components/graphs/LineChart/) are built on top of CartesianChart and have default functionality for your chart.
125
+
126
+ ```jsx
127
+ <VStack gap={2}>
128
+ <AreaChart
129
+ enableScrubbing
130
+ height={150}
131
+ series={[
132
+ {
133
+ id: 'prices',
134
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
135
+ },
136
+ ]}
137
+ curve="monotone"
138
+ showYAxis
139
+ yAxis={{
140
+ showGrid: true,
141
+ }}
142
+ >
143
+ <Scrubber />
144
+ </AreaChart>
145
+ <BarChart
146
+ enableScrubbing
147
+ height={150}
148
+ series={[
149
+ {
150
+ id: 'prices',
151
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
152
+ },
153
+ ]}
154
+ showYAxis
155
+ yAxis={{
156
+ showGrid: true,
157
+ }}
158
+ >
159
+ <Scrubber hideOverlay seriesIds={[]} />
160
+ </BarChart>
161
+ <LineChart
162
+ enableScrubbing
163
+ height={150}
164
+ series={[
165
+ {
166
+ id: 'prices',
167
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
168
+ },
169
+ ]}
170
+ curve="monotone"
171
+ showYAxis
172
+ showArea
173
+ yAxis={{
174
+ showGrid: true,
175
+ }}
176
+ >
177
+ <Scrubber />
178
+ </LineChart>
179
+ </VStack>
180
+ ```
181
+
182
+ ### Series
183
+
184
+ Series are the data that will be displayed on the chart. Each series must have a defined `id`.
185
+
186
+ #### Series Data
187
+
188
+ You can pass in an array of numbers or an array of tuples for the `data` prop. Passing in null values is equivalent to no data at that index.
189
+
190
+ ```jsx
191
+ function ForecastedPrice() {
192
+ const theme = useTheme();
193
+
194
+ const ForecastRect = memo(({ startIndex, endIndex }) => {
195
+ const { drawingArea, getXScale } = useCartesianChartContext();
196
+
197
+ const xScale = getXScale();
198
+
199
+ if (!xScale) return;
200
+
201
+ const startX = xScale(startIndex);
202
+ const endX = xScale(endIndex);
203
+ return (
204
+ <Rect
205
+ x={startX}
206
+ y={drawingArea.y}
207
+ width={endX - startX}
208
+ height={drawingArea.height}
209
+ fill={theme.color.accentSubtleBlue}
210
+ />
211
+ );
212
+ });
213
+ return (
214
+ <CartesianChart
215
+ enableScrubbing
216
+ height={150}
217
+ series={[
218
+ {
219
+ id: 'prices',
220
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 54, 60, 64, 68, 72, 76],
221
+ color: theme.color.accentBoldBlue,
222
+ },
223
+ {
224
+ id: 'variance',
225
+ data: [
226
+ null,
227
+ null,
228
+ null,
229
+ null,
230
+ null,
231
+ null,
232
+ null,
233
+ [52, 52],
234
+ [50, 57],
235
+ [52, 63],
236
+ [55, 75],
237
+ [57, 77],
238
+ [59, 79],
239
+ [60, 80],
240
+ ],
241
+ color: theme.color.accentBoldBlue,
242
+ },
243
+ ]}
244
+ yAxis={{
245
+ showGrid: true,
246
+ }}
247
+ >
248
+ <ForecastRect startIndex={7} endIndex={13} />
249
+ <Area seriesId="variance" type="solid" curve="monotone" fillOpacity={0.3} />
250
+ <Line seriesId="prices" curve="monotone" />
251
+ </CartesianChart>
252
+ );
253
+ }
254
+ ```
255
+
256
+ #### Series Axis IDs
257
+
258
+ Each series can have a different `yAxisId`, allowing you to compare data from different contexts.
259
+
260
+ ```jsx
261
+ function SeriesAxisIds() {
262
+ const theme = useTheme();
263
+
264
+ return (
265
+ <CartesianChart
266
+ height={150}
267
+ series={[
268
+ {
269
+ id: 'revenue',
270
+ data: [455, 520, 380, 455, 190, 235],
271
+ yAxisId: 'revenue',
272
+ color: theme.color.accentBoldYellow,
273
+ },
274
+ {
275
+ id: 'profit',
276
+ data: [23, 15, 30, 56, 4, 12],
277
+ yAxisId: 'profit',
278
+ color: theme.color.fgPositive,
279
+ },
280
+ ]}
281
+ xAxis={{
282
+ data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
283
+ scaleType: 'band',
284
+ }}
285
+ yAxis={[
286
+ {
287
+ id: 'revenue',
288
+ },
289
+ {
290
+ id: 'profit',
291
+ },
292
+ ]}
293
+ >
294
+ <XAxis showLine showTickMarks />
295
+ <YAxis
296
+ showGrid
297
+ showLine
298
+ showTickMarks
299
+ axisId="revenue"
300
+ position="left"
301
+ requestedTickCount={5}
302
+ tickLabelFormatter={(value) => `$${value}k`}
303
+ width={60}
304
+ />
305
+ <YAxis
306
+ showLine
307
+ showTickMarks
308
+ axisId="profit"
309
+ requestedTickCount={5}
310
+ tickLabelFormatter={(value) => `$${value}k`}
311
+ />
312
+ <BarPlot />
313
+ </CartesianChart>
314
+ );
315
+ }
316
+ ```
317
+
318
+ #### Series Stacks
319
+
320
+ You can provide a `stackId` to stack series together.
321
+
322
+ ```jsx
323
+ function SeriesStacks() {
324
+ const theme = useTheme();
325
+
326
+ return (
327
+ <AreaChart
328
+ enableScrubbing
329
+ height={150}
330
+ series={[
331
+ {
332
+ id: 'pricesA',
333
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
334
+ stackId: 'prices',
335
+ color: theme.color.accentBoldGreen,
336
+ },
337
+ {
338
+ id: 'pricesB',
339
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
340
+ stackId: 'prices',
341
+ color: theme.color.accentBoldPurple,
342
+ },
343
+ ]}
344
+ curve="monotone"
345
+ showYAxis
346
+ yAxis={{
347
+ showGrid: true,
348
+ }}
349
+ >
350
+ <Scrubber />
351
+ </LineChart>
352
+ );
353
+ }
354
+ ```
355
+
356
+ ### Axes
357
+
358
+ You can configure your x and y axes with the `xAxis` and `yAxis` props. `xAxis` accepts an object while `yAxis` accepts an object or array.
359
+
360
+ ```jsx
361
+ <CartesianChart
362
+ height={150}
363
+ series={[
364
+ {
365
+ id: 'prices',
366
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
367
+ },
368
+ ]}
369
+ xAxis={{
370
+ scaleType: 'band',
371
+ }}
372
+ yAxis={{
373
+ domain: { min: 0 },
374
+ }}
375
+ >
376
+ <YAxis showLine showTickMarks showGrid />
377
+ <XAxis showLine showTickMarks />
378
+ <BarPlot />
379
+ </CartesianChart>
380
+ ```
381
+
382
+ For more info, learn about [XAxis](/components/graphs/XAxis/#axis-config) and [YAxis](/components/graphs/YAxis/#axis-config) configuration.
383
+
384
+ ### Inset
385
+
386
+ You can adjust the inset around the entire chart (outside the axes) with the `inset` prop. This is useful for when you want to have components that are outside of the drawing area of the data but still within the chart svg.
387
+
388
+ You can also remove the default inset, such as to have a compact line chart.
389
+
390
+ ```jsx
391
+ function Insets() {
392
+ const theme = useTheme();
393
+
394
+ const data = [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58];
395
+
396
+ const formatPrice = useCallback((dataIndex: number) => {
397
+ const price = data[dataIndex];
398
+ return `$${price.toLocaleString('en-US', {
399
+ minimumFractionDigits: 2,
400
+ maximumFractionDigits: 2,
401
+ })}`;
402
+ }, []);
403
+
404
+ return (
405
+ <VStack gap={2}>
406
+ <VStack gap={1}>
407
+ <Text font="label1">No inset</Text>
408
+ <LineChart
409
+ height={100}
410
+ inset={0}
411
+ series={[
412
+ {
413
+ id: 'prices',
414
+ data,
415
+ },
416
+ ]}
417
+ yAxis={{ domainLimit: 'strict' }}
418
+ curve="monotone"
419
+ showArea
420
+ style={{ border: `2px solid ${theme.color.fgPrimary}` }}
421
+ />
422
+ </VStack>
423
+ <VStack gap={1}>
424
+ <Text font="label1">Custom inset</Text>
425
+ <LineChart
426
+ enableScrubbing
427
+ height={100}
428
+ inset={{ left: 10, top: 16, right: 10, bottom: 10 }}
429
+ series={[
430
+ {
431
+ id: 'prices',
432
+ data,
433
+ },
434
+ ]}
435
+ yAxis={{ domainLimit: 'strict' }}
436
+ curve="monotone"
437
+ showArea
438
+ style={{ border: `2px solid ${theme.color.fgPrimary}` }}
439
+ >
440
+ <Scrubber label={formatPrice} />
441
+ </LineChart>
442
+ </VStack>
443
+ <VStack gap={1}>
444
+ <Text font="label1">Default inset</Text>
445
+ <LineChart
446
+ enableScrubbing
447
+ height={100}
448
+ series={[
449
+ {
450
+ id: 'prices',
451
+ data,
452
+ },
453
+ ]}
454
+ yAxis={{ domainLimit: 'strict' }}
455
+ curve="monotone"
456
+ showArea
457
+ style={{ border: `2px solid ${theme.color.fgPrimary}` }}
458
+ >
459
+ <Scrubber label={formatPrice} />
460
+ </LineChart>
461
+ </VStack>
462
+ </VStack>
463
+ );
464
+ }
465
+ ```
466
+
467
+ ### Scrubbing
468
+
469
+ CartesianChart has built-in scrubbing functionality that can be enabled with the `enableScrubbing` prop. This will then enable the usage of `onScrubberPositionChange` to get the current position of the scrubber as the user interacts with the chart.
470
+
471
+ One example of using the scrubber is to provide haptic feedback when the user interacts with the chart. You can trigger a light impact each time the scrubber position changes or even do a dynamic impact depending on the value change, such as a heavy impact when the user crosses a significant boundary of time or reaches a significant market event.
472
+
473
+ ```jsx
474
+ function Scrubbing() {
475
+ const [scrubIndex, setScrubIndex] = useState(undefined);
476
+
477
+ const onScrubberPositionChange = useCallback((index: number | undefined) => {
478
+ // Do a light impact when the scrubber position changes
479
+ // An initial and final impact is already configured by the chart
480
+ if (scrubIndex !== undefined && index !== undefined) {
481
+ void Haptics.lightImpact();
482
+ }
483
+ setScrubIndex(index);
484
+ }, [scrubIndex]);
485
+
486
+ return (
487
+ <VStack gap={2}>
488
+ <Text font="label1">Scrubber index: {scrubIndex ?? 'none'}</Text>
489
+ <LineChart
490
+ enableScrubbing
491
+ onScrubberPositionChange={onScrubberPositionChange}
492
+ height={150}
493
+ series={[
494
+ {
495
+ id: 'prices',
496
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
497
+ },
498
+ ]}
499
+ curve="monotone"
500
+ showYAxis
501
+ showArea
502
+ yAxis={{
503
+ showGrid: true,
504
+ width: 32
505
+ }}
506
+ inset={{ right: 0 }}
507
+ >
508
+ <Scrubber />
509
+ </LineChart>
510
+ </VStack>
511
+ );
512
+ }
513
+ ```
514
+
515
+ ### Customization
516
+
517
+ #### Price with Volume
518
+
519
+ You can showcase the price and volume of an asset over time within one chart.
520
+
521
+ ```jsx
522
+ function PriceWithVolume() {
523
+ const theme = useTheme();
524
+
525
+ const [scrubIndex, setScrubIndex] = useState(null);
526
+ const btcData = btcCandles
527
+ .slice(0, 180)
528
+ .reverse()
529
+
530
+ const btcPrices = btcData.map((candle) => parseFloat(candle.close));
531
+ const btcVolumes = btcData.map((candle) => parseFloat(candle.volume));
532
+ const btcDates = btcData.map((candle) => new Date(parseInt(candle.start) * 1000));
533
+
534
+ const formatPrice = useCallback((price: number) => {
535
+ return `$${price.toLocaleString('en-US', {
536
+ minimumFractionDigits: 2,
537
+ maximumFractionDigits: 2,
538
+ })}`;
539
+ }, []);
540
+
541
+ const formatPriceInThousands = useCallback((price: number) => {
542
+ return `$${(price / 1000).toLocaleString('en-US', {
543
+ minimumFractionDigits: 0,
544
+ maximumFractionDigits: 2,
545
+ })}k`;
546
+ }, []);
547
+
548
+ const formatVolume = useCallback((volume: number) => {
549
+ return `${(volume / 1000).toFixed(2)}K`;
550
+ }, []);
551
+
552
+ const formatDate = useCallback((date: Date) => {
553
+ return date.toLocaleDateString('en-US', {
554
+ month: 'short',
555
+ day: 'numeric',
556
+ });
557
+ }, []);
558
+
559
+ const displayIndex = scrubIndex ?? btcPrices.length - 1;
560
+ const currentPrice = btcPrices[displayIndex];
561
+ const currentVolume = btcVolumes[displayIndex];
562
+ const currentDate = btcDates[displayIndex];
563
+ const priceChange = displayIndex > 0
564
+ ? ((currentPrice - btcPrices[displayIndex - 1]) / btcPrices[displayIndex - 1])
565
+ : 0;
566
+
567
+ const accessibilityLabel = useMemo(() => {
568
+ if (scrubIndex === null) return `Current Bitcoin price: ${formatPrice(currentPrice)}, Volume: ${formatVolume(currentVolume)}`;
569
+ return `Bitcoin price at ${formatDate(currentDate)}: ${formatPrice(currentPrice)}, Volume: ${formatVolume(currentVolume)}`;
570
+ }, [scrubIndex, currentPrice, currentVolume, currentDate, formatPrice, formatVolume, formatDate]);
571
+
572
+ const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
573
+
574
+ const headerId = useId();
575
+
576
+ return (
577
+ <VStack gap={2}>
578
+ <SectionHeader
579
+ id={headerId}
580
+ style={{ padding: 0 }}
581
+ title={<Text font="title1">Bitcoin</Text>}
582
+ balance={<Text font="title2">{formatPrice(currentPrice)}</Text>}
583
+ end={
584
+ <HStack gap={2}>
585
+ <VStack justifyContent="center" alignItems="flex-end">
586
+ <Text font="label1">{formatDate(currentDate)}</Text>
587
+ <Text font="label2">{formatVolume(currentVolume)}</Text>
588
+ </VStack>
589
+ <VStack justifyContent="center">
590
+ <RemoteImage source={assets.btc.imageUrl} size="xl" shape="circle" />
591
+ </VStack>
592
+ </HStack>
593
+ }
594
+ />
595
+ <CartesianChart
596
+ enableScrubbing
597
+ onScrubberPositionChange={setScrubIndex}
598
+ height={150}
599
+ series={[
600
+ {
601
+ id: 'prices',
602
+ data: btcPrices,
603
+ color: assets.btc.color,
604
+ yAxisId: 'price',
605
+ },
606
+ {
607
+ id: 'volume',
608
+ data: btcVolumes,
609
+ color: theme.color.fgMuted,
610
+ yAxisId: 'volume',
611
+ },
612
+ ]}
613
+ style={{ outlineColor: assets.btc.color }}
614
+ xAxis={{ scaleType: 'band', range: ({ min, max }) => ({ min, max: max - 16 }) }}
615
+ yAxis={[
616
+ {
617
+ id: 'price',
618
+ domain: ({ min, max }) => ({ min: min * 0.9, max }),
619
+ },
620
+ {
621
+ id: 'volume',
622
+ range: ({ min, max }) => ({ min: max - 32, max }),
623
+ },
624
+ ]}
625
+ accessibilityLabel={accessibilityLabel}
626
+ aria-labelledby={headerId}
627
+ inset={{ top: 8, left: 8, right: 0, bottom: 0 }}
628
+ >
629
+ <YAxis axisId="price" showGrid tickLabelFormatter={formatPriceInThousands} width={48} GridLineComponent={ThinSolidLine} />
630
+ <BarPlot seriesIds={['volume']} />
631
+ <Line seriesId="prices" curve="monotone" showArea />
632
+ <Scrubber seriesIds={['prices']} />
633
+ </CartesianChart>
634
+ </VStack>
635
+ );
636
+ }
637
+ ```
638
+
639
+ #### Earnings History
640
+
641
+ You can also create your own type of cartesian chart by using `getSeriesData`, `getXScale`, and `getYScale` directly.
642
+
643
+ ```jsx
644
+ function EarningsHistory() {
645
+ const theme = useTheme();
646
+ const CirclePlot = memo(({ seriesId, opacity = 1 }: { seriesId: string, opacity?: number }) => {
647
+ const { drawingArea, getSeries, getSeriesData, getXScale, getYScale } = useCartesianChartContext();
648
+ const series = getSeries(seriesId);
649
+ const data = getSeriesData(seriesId);
650
+ const xScale = getXScale();
651
+ const yScale = getYScale(series?.yAxisId);
652
+
653
+ if (!xScale || !yScale || !data || !isCategoricalScale(xScale)) return null;
654
+
655
+ const yScaleSize = Math.abs(yScale.range()[1] - yScale.range()[0]);
656
+
657
+ // Have circle diameter be the smaller of the x scale bandwidth or 10% of the y space available
658
+ const diameter = Math.min(xScale.bandwidth(), yScaleSize / 10);
659
+
660
+ return (
661
+ <G>
662
+ {data.map((value, index) => {
663
+ if (value === null || value === undefined) return null;
664
+
665
+ // Get x position from band scale - center of the band
666
+ const xPos = xScale(index);
667
+ if (xPos === undefined) return null;
668
+
669
+ const centerX = xPos + xScale.bandwidth() / 2;
670
+
671
+ // Get y position from value
672
+ const yValue = Array.isArray(value) ? value[1] : value;
673
+ const centerY = yScale(yValue);
674
+ if (centerY === undefined) return null;
675
+
676
+ return (
677
+ <Circle
678
+ key={`${seriesId}-${index}`}
679
+ cx={centerX}
680
+ cy={centerY}
681
+ fill={series?.color || theme.color.fgPrimary}
682
+ opacity={opacity}
683
+ r={diameter / 2}
684
+ />
685
+ );
686
+ })}
687
+ </G>
688
+ );
689
+ });
690
+
691
+ const quarters = useMemo(() => ['Q1', 'Q2', 'Q3', 'Q4'], []);
692
+ const estimatedEPS = useMemo(() => [1.71, 1.82, 1.93, 2.34], []);
693
+ const actualEPS = useMemo(() => [1.68, 1.83, 2.01, 2.24], []);
694
+
695
+ const formatEarningAmount = useCallback((value: number) => {
696
+ return `$${value.toLocaleString('en-US', {
697
+ minimumFractionDigits: 2,
698
+ maximumFractionDigits: 2,
699
+ })}`;
700
+ }, []);
701
+
702
+ const surprisePercentage = useCallback(
703
+ (index: number): ChartTextChildren => {
704
+ const percentage = (actualEPS[index] - estimatedEPS[index]) / estimatedEPS[index];
705
+ const percentageString = percentage.toLocaleString('en-US', {
706
+ style: 'percent',
707
+ minimumFractionDigits: 2,
708
+ maximumFractionDigits: 2,
709
+ });
710
+
711
+ return (
712
+ <tspan
713
+ style={{
714
+ fill: percentage > 0 ? theme.color.fgPositive : theme.color.fgNegative,
715
+ fontWeight: 'bold',
716
+ }}
717
+ >
718
+ {percentage > 0 ? '+' : ''}
719
+ {percentageString}
720
+ </tspan>
721
+ );
722
+ },
723
+ [actualEPS, estimatedEPS],
724
+ );
725
+
726
+ const LegendItem = memo(({ opacity = 1, label }: { opacity?: number, label: string }) => {
727
+ return (
728
+ <Box alignItems="center" gap={0.5}>
729
+ <LegendDot opacity={opacity} />
730
+ <Text font="label2">{label}</Text>
731
+ </Box>
732
+ );
733
+ });
734
+
735
+ const LegendDot = memo((props: BoxBaseProps) => {
736
+ return <Box borderRadius={1000} width={10} height={10} background="bgPositive" {...props} />;
737
+ });
738
+
739
+ return (
740
+ <VStack gap={0.5}>
741
+ <CartesianChart
742
+ overflow="visible"
743
+ animate={false}
744
+ height={150}
745
+ padding={0}
746
+ series={[
747
+ {
748
+ id: 'estimatedEPS',
749
+ data: estimatedEPS,
750
+ color: theme.color.bgPositive,
751
+ },
752
+ { id: 'actualEPS', data: actualEPS, color: theme.color.bgPositive },
753
+ ]}
754
+ xAxis={{ scaleType: 'band', categoryPadding: 0.25 }}
755
+ >
756
+ <YAxis
757
+ showGrid
758
+ position="left"
759
+ requestedTickCount={3}
760
+ tickLabelFormatter={formatEarningAmount}
761
+ />
762
+ <XAxis height={20} tickLabelFormatter={(index) => quarters[index]} />
763
+ <XAxis height={20} tickLabelFormatter={surprisePercentage} />
764
+ <CirclePlot opacity={0.5} seriesId="estimatedEPS" />
765
+ <CirclePlot seriesId="actualEPS" />
766
+ </CartesianChart>
767
+ <HStack justifyContent="flex-end" gap={2}>
768
+ <LegendItem opacity={0.5} label="Estimated EPS" />
769
+ <LegendItem label="Actual EPS" />
770
+ </HStack>
771
+ </VStack>
772
+ );
773
+ }
774
+ ```
775
+
776
+ #### Trading Trends
777
+
778
+ You can have multiple axes with different domains and ranges to showcase different pieces of data over the time time period.
779
+
780
+ ```jsx
781
+ function TradingTrends() {
782
+ const theme = useTheme();
783
+
784
+ function TradingTrends() {
785
+ const profitData = [34, 24, 28, -4, 8, -16, -3, 12, 24, 18, 20, 28];
786
+ const gains = profitData.map((value) => (value > 0 ? value : 0));
787
+ const losses = profitData.map((value) => (value < 0 ? value : 0));
788
+
789
+ const renderProfit = useCallback((value: number) => {
790
+ return `$${value}M`;
791
+ }, []);
792
+
793
+ const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} strokeLinecap="butt" />);
794
+ const ThickSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={2} strokeLinecap="butt" />);
795
+
796
+ return (
797
+ <CartesianChart
798
+ height={150}
799
+ series={[
800
+ { id: 'gains', data: gains, yAxisId: 'profit', color: theme.color.bgPositive, stackId: 'bars' },
801
+ { id: 'losses', data: losses, yAxisId: 'profit', color: theme.color.bgNegative, stackId: 'bars' },
802
+ {
803
+ id: 'revenue',
804
+ data: [128, 118, 122, 116, 120, 114, 118, 122, 126, 130, 134, 138],
805
+ yAxisId: 'revenue',
806
+ color: theme.color.fgMuted,
807
+ },
808
+ ]}
809
+ xAxis={{ scaleType: 'band', data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }}
810
+ yAxis={[
811
+ { id: 'profit', range: ({ min, max }) => ({ min: min, max: max - 64 }), domain: { min: -40, max: 40 } },
812
+ { id: 'revenue', range: ({ min, max }) => ({ min: max - 64, max }), domain: { min: 100 } },
813
+ ]}
814
+ >
815
+ <YAxis axisId="profit" position="left" showGrid tickLabelFormatter={renderProfit} GridLineComponent={ThinSolidLine} />
816
+ <XAxis />
817
+ <ReferenceLine LineComponent={ThickSolidLine} dataY={0} yAxisId="profit" stroke={`rgba(${theme.color.gray15.slice(4)})`} />
818
+ <BarPlot seriesIds={['gains', 'losses']} />
819
+ <Line seriesId="revenue" curve="monotone" showArea />
820
+ </CartesianChart>
821
+ );
822
+ }
823
+ }
824
+ ```
825
+
826
+