@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,816 @@
1
+ # BarChart
2
+
3
+ A bar chart component for comparing values across categories. Supports horizontal and vertical orientations, stacked bars, and grouped series.
4
+
5
+ ## Import
6
+
7
+ ```jsx
8
+ import { BarChart } from '@coinbase/cds-mobile-visualization'
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Required | Default | Description |
14
+ | --- | --- | --- | --- | --- |
15
+ | `BarComponent` | `BarComponent` | No | `-` | Component to render the bar. |
16
+ | `BarStackComponent` | `BarStackComponent` | No | `DefaultBarStack` | Custom component to render the stack container. Can be used to add clip paths, outlines, or other custom styling. |
17
+ | `alignContent` | `flex-start \| flex-end \| center \| stretch \| space-between \| space-around \| space-evenly` | No | `-` | - |
18
+ | `alignItems` | `flex-start \| flex-end \| center \| stretch \| baseline` | No | `-` | - |
19
+ | `alignSelf` | `auto \| FlexAlignType` | No | `-` | - |
20
+ | `allowOverflowGestures` | `boolean` | No | `-` | Allows continuous gestures on the chart to continue outside the bounds of the chart element. |
21
+ | `animate` | `boolean` | No | `true` | Whether to animate the chart. |
22
+ | `animated` | `boolean` | No | `-` | - |
23
+ | `aspectRatio` | `string \| number` | No | `-` | - |
24
+ | `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 | `-` | - |
25
+ | `barMinSize` | `number` | No | `-` | Minimum size for individual bars in the stack. |
26
+ | `barPadding` | `number` | No | `0.1` | Padding between bar groups (0-1). |
27
+ | `borderBottomLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
28
+ | `borderBottomRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
29
+ | `borderBottomWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
30
+ | `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 | `-` | - |
31
+ | `borderEndWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
32
+ | `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `4` | Border radius of the bar. Border radius for the bar. |
33
+ | `borderStartWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
34
+ | `borderTopLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
35
+ | `borderTopRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
36
+ | `borderTopWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
37
+ | `borderWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
38
+ | `bordered` | `boolean` | No | `-` | Add a border around all sides of the box. |
39
+ | `borderedBottom` | `boolean` | No | `-` | Add a border to the bottom side of the box. |
40
+ | `borderedEnd` | `boolean` | No | `-` | Add a border to the trailing side of the box. |
41
+ | `borderedHorizontal` | `boolean` | No | `-` | Add a border to the leading and trailing sides of the box. |
42
+ | `borderedStart` | `boolean` | No | `-` | Add a border to the leading side of the box. |
43
+ | `borderedTop` | `boolean` | No | `-` | Add a border to the top side of the box. |
44
+ | `borderedVertical` | `boolean` | No | `-` | Add a border to the top and bottom sides of the box. |
45
+ | `bottom` | `string \| number` | No | `-` | - |
46
+ | `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 | `-` | - |
47
+ | `columnGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
48
+ | `dangerouslySetBackground` | `string` | No | `-` | - |
49
+ | `display` | `flex \| none` | No | `-` | - |
50
+ | `elevation` | `0 \| 1 \| 2` | No | `-` | Determines box shadow styles. Parent should have overflow set to visible to ensure styles are not clipped. |
51
+ | `enableScrubbing` | `boolean` | No | `-` | Enables scrubbing interactions. When true, allows scrubbing and makes scrubber components interactive. |
52
+ | `fillOpacity` | `number` | No | `-` | Fill opacity for the bar. |
53
+ | `flexBasis` | `string \| number` | No | `-` | - |
54
+ | `flexDirection` | `row \| column \| row-reverse \| column-reverse` | No | `-` | - |
55
+ | `flexGrow` | `number` | No | `-` | - |
56
+ | `flexShrink` | `number` | No | `-` | - |
57
+ | `flexWrap` | `wrap \| nowrap \| wrap-reverse` | No | `-` | - |
58
+ | `font` | `inherit \| FontFamily` | No | `-` | - |
59
+ | `fontFamily` | `inherit \| FontFamily` | No | `-` | - |
60
+ | `fontSize` | `inherit \| FontSize` | No | `-` | - |
61
+ | `fontWeight` | `inherit \| FontWeight` | No | `-` | - |
62
+ | `gap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
63
+ | `height` | `string \| number` | No | `-` | Chart height. If not provided, will use the containers measured height. |
64
+ | `inset` | `number \| Partial<ChartInset>` | No | `-` | Inset around the entire chart (outside the axes). |
65
+ | `justifyContent` | `flex-start \| flex-end \| center \| space-between \| space-around \| space-evenly` | No | `-` | - |
66
+ | `key` | `Key \| null` | No | `-` | - |
67
+ | `left` | `string \| number` | No | `-` | - |
68
+ | `lineHeight` | `inherit \| LineHeight` | No | `-` | - |
69
+ | `margin` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
70
+ | `marginBottom` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
71
+ | `marginEnd` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
72
+ | `marginStart` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
73
+ | `marginTop` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
74
+ | `marginX` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
75
+ | `marginY` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
76
+ | `maxHeight` | `string \| number` | No | `-` | - |
77
+ | `maxWidth` | `string \| number` | No | `-` | - |
78
+ | `minHeight` | `string \| number` | No | `-` | - |
79
+ | `minWidth` | `string \| number` | No | `-` | - |
80
+ | `onPointerCancel` | `((event: PointerEvent) => void)` | No | `-` | - |
81
+ | `onPointerCancelCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
82
+ | `onPointerDown` | `((event: PointerEvent) => void)` | No | `-` | - |
83
+ | `onPointerDownCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
84
+ | `onPointerEnter` | `((event: PointerEvent) => void)` | No | `-` | - |
85
+ | `onPointerEnterCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
86
+ | `onPointerLeave` | `((event: PointerEvent) => void)` | No | `-` | - |
87
+ | `onPointerLeaveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
88
+ | `onPointerMove` | `((event: PointerEvent) => void)` | No | `-` | - |
89
+ | `onPointerMoveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
90
+ | `onPointerUp` | `((event: PointerEvent) => void)` | No | `-` | - |
91
+ | `onPointerUpCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
92
+ | `onScrubberPositionChange` | `((index: number) => void) \| undefined` | No | `-` | Callback fired when the scrubber position changes. Receives the dataIndex of the scrubber or undefined when not scrubbing. |
93
+ | `opacity` | `number \| AnimatedNode` | No | `-` | - |
94
+ | `overflow` | `visible \| hidden \| scroll` | No | `-` | - |
95
+ | `padding` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
96
+ | `paddingBottom` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
97
+ | `paddingEnd` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
98
+ | `paddingStart` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
99
+ | `paddingTop` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
100
+ | `paddingX` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
101
+ | `paddingY` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
102
+ | `pin` | `top \| bottom \| left \| right \| all` | No | `-` | Direction in which to absolutely pin the box. |
103
+ | `position` | `absolute \| relative \| static \| fixed \| sticky` | No | `-` | - |
104
+ | `ref` | `((instance: View \| null) => void) \| RefObject<View> \| null` | No | `-` | - |
105
+ | `right` | `string \| number` | No | `-` | - |
106
+ | `roundBaseline` | `boolean` | No | `-` | Whether to round the baseline of a bar (where the value is 0). |
107
+ | `rowGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
108
+ | `series` | `BarSeries[]` | No | `-` | Configuration objects that define how to visualize the data. Each series supports Bar component props for individual customization. |
109
+ | `showXAxis` | `boolean` | No | `-` | Whether to show the X axis. |
110
+ | `showYAxis` | `boolean` | No | `-` | Whether to show the Y axis. |
111
+ | `stackGap` | `number` | No | `-` | Gap between bars in the stack. |
112
+ | `stackMinSize` | `number` | No | `-` | Minimum size for the entire stack. |
113
+ | `stacked` | `boolean` | No | `-` | Whether to stack the areas on top of each other. When true, each series builds cumulative values on top of the previous series. **Note**: Only applies to series data containing singular numbers (e.g., [10, 20, 30]). Series with start & end value tuples (e.g., [[0, 10], [5, 20]]) will be skipped during stacking and rendered as-is. |
114
+ | `stroke` | `string` | No | `-` | Stroke color for the bar outline. |
115
+ | `strokeWidth` | `number` | No | `-` | Stroke width for the bar outline. |
116
+ | `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 | `-` | - |
117
+ | `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. |
118
+ | `textAlign` | `auto \| left \| right \| center \| justify` | No | `-` | - |
119
+ | `textDecorationLine` | `none \| underline \| line-through \| underline line-through` | No | `-` | - |
120
+ | `textDecorationStyle` | `solid \| dotted \| dashed \| double` | No | `-` | - |
121
+ | `textTransform` | `none \| capitalize \| uppercase \| lowercase` | No | `-` | - |
122
+ | `top` | `string \| number` | No | `-` | - |
123
+ | `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 | `-` | - |
124
+ | `userSelect` | `auto \| none \| text \| contain \| all` | No | `-` | - |
125
+ | `width` | `string \| number` | No | `-` | Chart width. If not provided, will use the containers measured width. |
126
+ | `xAxis` | `(Partial<AxisConfigProps> & AxisBaseProps & { className?: string; classNames?: { root?: string \| undefined; tickLabel?: string \| undefined; gridLine?: string \| undefined; line?: string \| undefined; tickMark?: string \| undefined; } \| undefined; style?: CSSProperties \| undefined; styles?: { root?: CSSProperties \| undefined; tickLabel?: CSSProperties \| undefined; gridLine?: CSSProperties \| undefined; line?: CSSProperties \| undefined; tickMark?: CSSProperties \| undefined; } \| undefined; } & { position?: top \| bottom \| undefined; height?: number \| undefined; }) \| undefined` | No | `-` | - |
127
+ | `yAxis` | `(Partial<AxisConfigProps> & AxisBaseProps & { className?: string; classNames?: { root?: string \| undefined; tickLabel?: string \| undefined; gridLine?: string \| undefined; line?: string \| undefined; tickMark?: string \| undefined; } \| undefined; style?: CSSProperties \| undefined; styles?: { root?: CSSProperties \| undefined; tickLabel?: CSSProperties \| undefined; gridLine?: CSSProperties \| undefined; line?: CSSProperties \| undefined; tickMark?: CSSProperties \| undefined; } \| undefined; } & { axisId?: string \| undefined; position?: left \| right \| undefined; width?: number \| undefined; }) \| undefined` | No | `-` | - |
128
+ | `zIndex` | `number` | No | `-` | - |
129
+
130
+
131
+ ## Examples
132
+
133
+ ### Basic Example
134
+
135
+ Bar charts are a useful component for comparing discrete categories of data.
136
+ They are helpful for highlighting trends to users or allowing them to compare proportions at a glance.
137
+
138
+ To start, pass in a series of data to the chart.
139
+
140
+ ```jsx
141
+ <BarChart
142
+ height={150}
143
+ inset={{ top: 8, bottom: 8, left: 0, right: 0 }}
144
+ series={[
145
+ {
146
+ id: 'prices',
147
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
148
+ },
149
+ ]}
150
+ curve="monotone"
151
+ showYAxis
152
+ yAxis={{
153
+ showGrid: true,
154
+ }}
155
+ />
156
+ ```
157
+
158
+ ### Multiple Series
159
+
160
+ You can also provide multiple series of data to the chart. Series will have their bars for each data point rendered side by side.
161
+
162
+ ```jsx
163
+ function MonthlyGainsByAsset() {
164
+ const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
165
+
166
+ const tickFormatter = useCallback(
167
+ (amount) =>
168
+ new Intl.NumberFormat('en-US', {
169
+ style: 'currency',
170
+ currency: 'USD',
171
+ }).format(amount),
172
+ [],
173
+ );
174
+
175
+ return (
176
+ <BarChart
177
+ height={150}
178
+ inset={{ top: 8, bottom: 8, left: 0, right: 0 }}
179
+ series={[
180
+ {
181
+ id: 'btc',
182
+ data: [
183
+ 345.82, 510.63, 280.19, 720.5, 655.37, 410.23, 580.96, 815.44, 740.18, 910.71, 975.02,
184
+ 620.57,
185
+ ],
186
+ color: assets.btc.color,
187
+ },
188
+ {
189
+ id: 'eth',
190
+ data: [
191
+ 270.49, 425.21, 190.75, 680.91, 610.88, 350.67, 440.11, 780.08, 705.83, 840.26, 920.65,
192
+ 550.93,
193
+ ],
194
+ color: assets.eth.color,
195
+ },
196
+ ]}
197
+ showYAxis
198
+ yAxis={{
199
+ showGrid: true,
200
+ GridLineComponent: ThinSolidLine,
201
+ tickLabelFormatter: tickFormatter,
202
+ width: 70,
203
+ }}
204
+ />
205
+ );
206
+ }
207
+ ```
208
+
209
+ ### Series Stacking
210
+
211
+ You can also configure stacking for your chart using the `stacked` prop.
212
+
213
+ ```jsx
214
+ function MonthlyGainsByAsset() {
215
+ const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
216
+
217
+ const tickFormatter = useCallback(
218
+ (amount) =>
219
+ new Intl.NumberFormat('en-US', {
220
+ style: 'currency',
221
+ currency: 'USD',
222
+ }).format(amount),
223
+ [],
224
+ );
225
+
226
+ return (
227
+ <BarChart
228
+ height={150}
229
+ inset={{ top: 8, bottom: 8, left: 0, right: 0 }}
230
+ series={[
231
+ {
232
+ id: 'xrp',
233
+ data: [
234
+ 170.22, 340.34, 305.98, 225.39, 250.76, 130.53, 115.81, 195.04, 210.28, 60.42, 120.94,
235
+ 85.12,
236
+ ],
237
+ color: assets.xrp.color,
238
+ },
239
+ {
240
+ id: 'ltc',
241
+ data: [
242
+ 450.77, 615.33, 355.68, 880.15, 810.99, 520.46, 590.29, 960.52, 910.07, 1020.41, 851.89,
243
+ 750.61,
244
+ ],
245
+ color: assets.ltc.color,
246
+ },
247
+ {
248
+ id: 'eth',
249
+ data: [
250
+ 270.49, 425.21, 190.75, 680.91, 610.88, 350.67, 440.11, 780.08, 705.83, 840.26, 920.65,
251
+ 550.93,
252
+ ],
253
+ color: assets.eth.color,
254
+ },
255
+ {
256
+ id: 'btc',
257
+ data: [
258
+ 345.82, 510.63, 280.19, 720.5, 655.37, 410.23, 580.96, 815.44, 740.18, 910.71, 975.02,
259
+ 620.57,
260
+ ],
261
+ color: assets.btc.color,
262
+ },
263
+ ]}
264
+ stacked
265
+ showYAxis
266
+ yAxis={{
267
+ showGrid: true,
268
+ GridLineComponent: ThinSolidLine,
269
+ tickLabelFormatter: tickFormatter,
270
+ width: 70,
271
+ }}
272
+ />
273
+ );
274
+ }
275
+ ```
276
+
277
+ You can also configure multiple stacks by setting the `stackId` prop on each series.
278
+
279
+ ```jsx
280
+ function MonthlyGainsMultipleStacks() {
281
+ const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
282
+
283
+ const tickFormatter = useCallback(
284
+ (amount) =>
285
+ new Intl.NumberFormat('en-US', {
286
+ style: 'currency',
287
+ currency: 'USD',
288
+ }).format(amount),
289
+ [],
290
+ );
291
+
292
+ return (
293
+ <BarChart
294
+ height={150}
295
+ inset={{ top: 8, bottom: 8, left: 0, right: 0 }}
296
+ series={[
297
+ {
298
+ id: 'xrp',
299
+ data: [
300
+ 170.22, 340.34, 305.98, 225.39, 250.76, 130.53, 115.81, 195.04, 210.28, 60.42, 120.94,
301
+ 85.12,
302
+ ],
303
+ color: assets.xrp.color,
304
+ stackId: 'shortTerm',
305
+ },
306
+ {
307
+ id: 'ltc',
308
+ data: [
309
+ 450.77, 615.33, 355.68, 880.15, 810.99, 520.46, 590.29, 960.52, 910.07, 1020.41, 851.89,
310
+ 750.61,
311
+ ],
312
+ color: assets.ltc.color,
313
+ stackId: 'shortTerm',
314
+ },
315
+ {
316
+ id: 'eth',
317
+ data: [
318
+ 270.49, 425.21, 190.75, 680.91, 610.88, 350.67, 440.11, 780.08, 705.83, 840.26, 920.65,
319
+ 550.93,
320
+ ],
321
+ color: assets.eth.color,
322
+ stackId: 'longTerm',
323
+ },
324
+ {
325
+ id: 'btc',
326
+ data: [
327
+ 345.82, 510.63, 280.19, 720.5, 655.37, 410.23, 580.96, 815.44, 740.18, 910.71, 975.02,
328
+ 620.57,
329
+ ],
330
+ color: assets.btc.color,
331
+ stackId: 'longTerm',
332
+ },
333
+ ]}
334
+ stacked
335
+ showYAxis
336
+ yAxis={{
337
+ showGrid: true,
338
+ GridLineComponent: ThinSolidLine,
339
+ tickLabelFormatter: tickFormatter,
340
+ width: 70,
341
+ }}
342
+ />
343
+ );
344
+ }
345
+ ```
346
+
347
+ #### Stack Gap
348
+
349
+ ```jsx
350
+ function MonthlyGainsByAsset() {
351
+ const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
352
+
353
+ const tickFormatter = useCallback(
354
+ (amount) =>
355
+ new Intl.NumberFormat('en-US', {
356
+ style: 'currency',
357
+ currency: 'USD',
358
+ }).format(amount),
359
+ [],
360
+ );
361
+
362
+ return (
363
+ <BarChart
364
+ height={150}
365
+ inset={{ top: 8, bottom: 8, left: 0, right: 0 }}
366
+ series={[
367
+ {
368
+ id: 'xrp',
369
+ data: [
370
+ 170.22, 340.34, 305.98, 225.39, 250.76, 130.53, 115.81, 195.04, 210.28, 60.42, 120.94,
371
+ 500,
372
+ ],
373
+ color: assets.xrp.color,
374
+ },
375
+ {
376
+ id: 'ltc',
377
+ data: [
378
+ 450.77, 615.33, 355.68, 880.15, 810.99, 520.46, 590.29, 960.52, 910.07, 1020.41, 851.89,
379
+ 500,
380
+ ],
381
+ color: assets.ltc.color,
382
+ },
383
+ {
384
+ id: 'eth',
385
+ data: [
386
+ 270.49, 425.21, 190.75, 680.91, 610.88, 350.67, 440.11, 780.08, 705.83, 840.26, 920.65,
387
+ 500,
388
+ ],
389
+ color: assets.eth.color,
390
+ },
391
+ {
392
+ id: 'btc',
393
+ data: [
394
+ 345.82, 510.63, 280.19, 720.5, 655.37, 410.23, 580.96, 815.44, 740.18, 910.71, 975.02,
395
+ 500,
396
+ ],
397
+ color: assets.btc.color,
398
+ },
399
+ ]}
400
+ stackGap={4}
401
+ stacked
402
+ showYAxis
403
+ yAxis={{
404
+ showGrid: true,
405
+ GridLineComponent: ThinSolidLine,
406
+ tickLabelFormatter: tickFormatter,
407
+ width: 70,
408
+ domainLimit: 'strict'
409
+ }}
410
+ />
411
+ );
412
+ }
413
+ ```
414
+
415
+ ### Border Radius
416
+
417
+ Bars have a default border radius of `100`. You can change this by setting the `borderRadius` prop on the chart.
418
+
419
+ Stacks will only round the top corners of touching bars.
420
+
421
+ ```jsx
422
+ <BarChart
423
+ stacked
424
+ borderRadius={1000}
425
+ height={300}
426
+ maxWidth={400}
427
+ padding={0}
428
+ series={[
429
+ { id: 'purple', data: [null, 6, 8, 10, 7, 6, 6, 8, 9, 12, 10, 4], color: '#b399ff' },
430
+ { id: 'blue', data: [null, 10, 12, 11, 10, 9, 10, 11, 7, 4, 12, 18], color: '#4f7cff' },
431
+ { id: 'cyan', data: [null, 7, 10, 12, 11, 10, 8, 11, 5, 12, 2, 9], color: '#00c2df' },
432
+ {
433
+ id: 'green',
434
+ data: [10, null, null, null, 1, null, null, 6, null, null, null, null],
435
+ color: '#33c481',
436
+ },
437
+ ]}
438
+ showXAxis
439
+ xAxis={{
440
+ data: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
441
+ tickLabelFormatter: (value) => {
442
+ if (value === 'D') {
443
+ return <Tspan style={{ fontWeight: 'bold' }}>{value}</TSpan>;
444
+ }
445
+ return value;
446
+ },
447
+ }}
448
+ style={{ margin: '0 auto' }}
449
+ />
450
+ ```
451
+
452
+ #### Round Baseline
453
+
454
+ You can also round the baseline of the bars by setting the `roundBaseline` prop on the chart.
455
+
456
+ ```jsx
457
+ <BarChart
458
+ roundBaseline
459
+ stacked
460
+ borderRadius={1000}
461
+ height={300}
462
+ maxWidth={400}
463
+ padding={0}
464
+ series={[
465
+ { id: 'purple', data: [null, 6, 8, 10, 7, 6, 6, 8, 9, 12, 10, 4], color: '#b399ff' },
466
+ { id: 'blue', data: [null, 10, 12, 11, 10, 9, 10, 11, 7, 4, 12, 18], color: '#4f7cff' },
467
+ { id: 'cyan', data: [null, 7, 10, 12, 11, 10, 8, 11, 5, 12, 2, 9], color: '#00c2df' },
468
+ {
469
+ id: 'green',
470
+ data: [10, null, null, null, 1, null, null, 6, null, null, null, null],
471
+ color: '#33c481',
472
+ },
473
+ ]}
474
+ showXAxis
475
+ xAxis={{
476
+ data: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
477
+ tickLabelFormatter: (value) => {
478
+ if (value === 'D') {
479
+ return <TSpan style={{ fontWeight: 'bold' }}>{value}</TSpan>;
480
+ }
481
+ return value;
482
+ },
483
+ }}
484
+ style={{ margin: '0 auto' }}
485
+ />
486
+ ```
487
+
488
+ ### Negative Data
489
+
490
+ ```jsx
491
+ function PositiveAndNegativeCashFlow() {
492
+ const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
493
+
494
+ const categories = Array.from({ length: 31 }, (_, i) => `3/${i + 1}`);
495
+ const gains = [
496
+ 5, 0, 6, 18, 0, 5, 12, 0, 12, 22, 28, 18, 0, 12, 6, 0, 0, 24, 0, 0, 4, 0, 18, 0, 0, 14, 10, 16,
497
+ 0, 0, 0,
498
+ ];
499
+
500
+ const losses = [
501
+ -4, 0, -8, -12, -6, 0, 0, 0, -18, 0, -12, 0, -9, -6, 0, 0, 0, 0, -22, -8, 0, 0, -10, -14, 0, 0,
502
+ 0, 0, 0, -12, -10,
503
+ ];
504
+ const series = [
505
+ { id: 'gains', data: gains, color: 'var(--color-fgPositive)' },
506
+ { id: 'losses', data: losses, color: 'var(--color-fgNegative)' },
507
+ ];
508
+
509
+ return (
510
+ <BarChart
511
+ height={150}
512
+ inset={{ top: 8, bottom: 8, left: 0, right: 0 }}
513
+ series={series}
514
+ xAxis={{ data: categories }}
515
+ stacked
516
+ showXAxis
517
+ showYAxis
518
+ yAxis={{
519
+ showGrid: true,
520
+ GridLineComponent: ThinSolidLine,
521
+ tickLabelFormatter: (value) => `$${value}M`,
522
+ }}
523
+ />
524
+ );
525
+ }
526
+ ```
527
+
528
+ ### Missing Bars
529
+
530
+ You can pass in `null` or `0` values to not render a bar for that data point.
531
+
532
+ ```jsx
533
+ <BarChart
534
+ showXAxis
535
+ showYAxis
536
+ height={150}
537
+ inset={{ top: 8, bottom: 8, left: 0, right: 0 }}
538
+ series={[
539
+ {
540
+ id: 'weekly-data',
541
+ data: [45, null, 38, 0, 19, null, 32],
542
+ },
543
+ ]}
544
+ xAxis={{
545
+ data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
546
+ showTickMarks: true,
547
+ showLine: true,
548
+ }}
549
+ yAxis={{
550
+ requestedTickCount: 5,
551
+ tickLabelFormatter: (value) => `$${value}k`,
552
+ showGrid: true,
553
+ showTickMarks: true,
554
+ showLine: true,
555
+ tickMarkSize: 1.5,
556
+ domain: { max: 50 },
557
+ }}
558
+ />
559
+ ```
560
+
561
+ You can also use the `BarStackComponent` prop to render an empty circle for zero values.
562
+
563
+ ```jsx
564
+ function MonthlyRewards() {
565
+ const months = ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'];
566
+ const currentMonth = 7;
567
+ const purple = [null, 6, 8, 10, 7, 6, 6, 8, null, null, null, null];
568
+ const blue = [null, 10, 12, 11, 10, 9, 10, 11, null, null, null, null];
569
+ const cyan = [null, 7, 10, 12, 11, 10, 8, 11, null, null, null, null];
570
+ const green = [10, null, null, null, 1, null, null, 6, null, null, null, null];
571
+
572
+ const series = [
573
+ { id: 'purple', data: purple, color: '#b399ff' },
574
+ { id: 'blue', data: blue, color: '#4f7cff' },
575
+ { id: 'cyan', data: cyan, color: '#00c2df' },
576
+ { id: 'green', data: green, color: '#33c481' },
577
+ ];
578
+
579
+ const CustomBarStackComponent = ({ children, ...props }: BarStackComponentProps) => {
580
+ if (props.height === 0) {
581
+ const diameter = props.width;
582
+ return (
583
+ <Bar
584
+ roundBottom
585
+ roundTop
586
+ borderRadius={1000}
587
+ fill="var(--color-bgTertiary)"
588
+ height={diameter}
589
+ width={diameter}
590
+ x={props.x}
591
+ y={props.y - diameter}
592
+ />
593
+ );
594
+ }
595
+
596
+ return <DefaultBarStack {...props}>{children}</DefaultBarStack>;
597
+ };
598
+
599
+ return (
600
+ <BarChart
601
+ roundBaseline
602
+ showXAxis
603
+ stacked
604
+ BarStackComponent={CustomBarStackComponent}
605
+ borderRadius={1000}
606
+ height={300}
607
+ inset={0}
608
+ series={series}
609
+ showYAxis={false}
610
+ stackMinSize={3}
611
+ width={403}
612
+ xAxis={{
613
+ tickLabelFormatter: (index) => {
614
+ if (index == currentMonth) {
615
+ return <TSpan style={{ fontWeight: 'bold' }}>{months[index]}</TSpan>;
616
+ }
617
+ return months[index];
618
+ },
619
+ categoryPadding: 0.27,
620
+ }}
621
+ />
622
+ );
623
+ };
624
+ ```
625
+
626
+ ### Customization
627
+
628
+ #### Bar Spacing
629
+
630
+ There are two ways to control the spacing between bars. You can set the `barPadding` prop to control the spacing between bars within a series. You can also set the `categoryPadding` prop to control the spacing between stacks of bars.
631
+
632
+ ```jsx
633
+ <BarChart
634
+ height={150}
635
+ inset={{ top: 8, bottom: 8, left: 0, right: 0 }}
636
+ series={[
637
+ {
638
+ id: 'pageViews',
639
+ data: [24, 13, 98, 39, 48, 38, 43],
640
+ color: 'var(--color-fgPositive)',
641
+ },
642
+ {
643
+ id: 'uniqueVisitors',
644
+ data: [12, 15, 18, 21, 24, 27, 30],
645
+ color: 'var(--color-fgNegative)',
646
+ },
647
+ ]}
648
+ borderRadius={0}
649
+ barPadding={0}
650
+ showYAxis
651
+ yAxis={{
652
+ showGrid: true,
653
+ }}
654
+ xAxis={{
655
+ categoryPadding: 0.2,
656
+ }}
657
+ />
658
+ ```
659
+
660
+ #### Minimum Size
661
+
662
+ To better emphasize small values, you can set the `stackMinSize` or `barMinSize` prop to control the minimum size for entire stacks or individual bar.
663
+ It is recommended to only use `stackMinSize` for stacked charts and `barMinSize` for non-stacked charts.
664
+
665
+ ##### Minimum Stack Size
666
+
667
+ You can set the `stackMinSize` prop to control the minimum size for entire stacks. This will only apply to stacks that have a value that is not `null` or `0`. It will proportionally scale the values of each bar in the stack to reach the minimum size.
668
+
669
+ ```jsx
670
+ <BarChart
671
+ height={150}
672
+ inset={{ top: 8, bottom: 8, left: 0, right: 0 }}
673
+ series={[
674
+ {
675
+ id: 'pageViews',
676
+ data: [24, 3, 98, null, 48, null, 43],
677
+ color: 'var(--color-fgPositive)',
678
+ },
679
+ {
680
+ id: 'uniqueVisitors',
681
+ data: [12, 1, 18, null, 24, 1, 30],
682
+ color: 'var(--color-fgNegative)',
683
+ },
684
+ ]}
685
+ stackMinSize={2}
686
+ stacked
687
+ showYAxis
688
+ yAxis={{
689
+ showGrid: true,
690
+ }}
691
+ />
692
+ ```
693
+
694
+ ##### Minimum Bar Size
695
+
696
+ You can also set the `barMinSize` prop to control the minimum size for individual bars. This will only apply to bars that have a value that is not `null` or `0`.
697
+
698
+ ```jsx
699
+ <BarChart
700
+ showXAxis
701
+ showYAxis
702
+ height={150}
703
+ inset={{ top: 8, bottom: 8, left: 0, right: 0 }}
704
+ series={[
705
+ {
706
+ id: 'weekly-data',
707
+ data: [45, 52, 0, 45, null, 1, 32],
708
+ },
709
+ ]}
710
+ xAxis={{
711
+ data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
712
+ showTickMarks: true,
713
+ showLine: true,
714
+ }}
715
+ yAxis={{
716
+ requestedTickCount: 5,
717
+ tickLabelFormatter: (value) => `$${value}k`,
718
+ showGrid: true,
719
+ showTickMarks: true,
720
+ showLine: true,
721
+ tickMarkSize: 1.5,
722
+ domain: { max: 50 },
723
+ }}
724
+ barMinSize={4}
725
+ />
726
+ ```
727
+
728
+ #### Multiple Y Axes
729
+
730
+ You can render bars from separate y axes in one `BarPlot`, however they aren't able to be stack.
731
+
732
+ ```jsx
733
+ function MultipleYAxes() {
734
+ const theme = useTheme();
735
+
736
+ return (
737
+ <VStack gap={2}>
738
+ <CartesianChart
739
+ height={150}
740
+ inset={{ top: 8, bottom: 8, left: 0, right: 0 }}
741
+ series={[
742
+ {
743
+ id: 'revenue',
744
+ data: [455, 520, 380, 455, 285, 235],
745
+ yAxisId: 'revenue',
746
+ color: theme.color.accentBoldYellow,
747
+ },
748
+ {
749
+ id: 'profitMargin',
750
+ data: [23, 20, 16, 38, 12, 9],
751
+ yAxisId: 'profitMargin',
752
+ color: theme.color.fgPositive,
753
+ },
754
+ ]}
755
+ xAxis={{
756
+ data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
757
+ scaleType: 'band',
758
+ }}
759
+ yAxis={[
760
+ {
761
+ id: 'revenue',
762
+ domain: { min: 0 },
763
+ },
764
+ {
765
+ id: 'profitMargin',
766
+ domain: { min: 0, max: 100 },
767
+ },
768
+ ]}
769
+ >
770
+ <XAxis showLine showTickMarks />
771
+ <YAxis
772
+ showGrid
773
+ showLine
774
+ showTickMarks
775
+ axisId="revenue"
776
+ position="left"
777
+ requestedTickCount={5}
778
+ width={60}
779
+ tickLabelFormatter={(value) => `$${value}k`}
780
+ />
781
+ <YAxis
782
+ showLine
783
+ showTickMarks
784
+ axisId="profitMargin"
785
+ position="right"
786
+ requestedTickCount={5}
787
+ tickLabelFormatter={(value) => `${value}%`}
788
+ />
789
+ <BarPlot />
790
+ </CartesianChart>
791
+ <HStack justifyContent="center" gap={2}>
792
+ <Box alignItems="center" gap={0.5}>
793
+ <Box
794
+ borderRadius={1000}
795
+ width={10}
796
+ height={10}
797
+ style={{ background: theme.color.accentBoldYellow }}
798
+ />
799
+ <Text font="label2">Revenue ($)</Text>
800
+ </Box>
801
+ <Box alignItems="center" gap={0.5}>
802
+ <Box
803
+ borderRadius={1000}
804
+ width={10}
805
+ height={10}
806
+ style={{ background: theme.color.fgPositive }}
807
+ />
808
+ <Text font="label2">Profit Margin (%)</Text>
809
+ </Box>
810
+ </HStack>
811
+ </VStack>
812
+ );
813
+ }
814
+ ```
815
+
816
+