Source: https://chartkit.io/about # About Chart Kit React Native charts from Berman Digital Ltd, an Ontario, Canada company. Last updated: September 6, 2026 ## Charts for mobile apps Chart Kit helps developers add charts to React Native apps. Use it for dashboards, reports, category comparisons, progress, and activity data. The public library includes line, area, bar, pie, donut, progress, and contribution heatmap charts. Charts render inside your application, where your application controls the data. ## Public library and Pro The [public source code](https://github.com/chart-kit/react-native-chart-kit) and the react-native-chart-kit npm package use the MIT license. Chart Kit Pro adds commercially licensed chart workflows, including candlebar, radar, realtime bar, combo charts, and export features. You can install the Pro package from npm. Production use requires the applicable commercial license. Berman Digital Ltd operates Chart Kit. Read the [developer guide](https://chartkit.io/developers) for installation and documentation access. Use the [contact page](https://chartkit.io/contact) for support and sales. The [privacy policy](https://chartkit.io/privacy) explains website data handling, and the [terms](https://chartkit.io/terms) explain purchases and license scope. --- Source: https://chartkit.io/contact # Contact Chart Kit Contact Berman Digital Ltd for Chart Kit support, sales, and license questions. Last updated: September 6, 2026 ## Technical support Email [support@chartkit.io](mailto:support@chartkit.io) for Chart Kit support. For a public library bug, use the [GitHub issue tracker](https://github.com/chart-kit/react-native-chart-kit/issues). Include the package version, React Native version, platform, chart type, and a small data sample. Describe the expected result and the actual result. Remove passwords, license details, and private customer data from public reports. The [troubleshooting guide](https://chartkit.io/docs/react-native/troubleshooting) covers common installation, rendering, and gesture problems. The [developer guide](https://chartkit.io/developers) links to examples, Markdown documentation, and the public documentation API. ## Sales and licensing Email [sales@chartkit.io](mailto:sales@chartkit.io) for Pro plans, license scope, and Enterprise purchasing questions. Include your team size and the number of production apps so we can identify the relevant plan. Berman Digital Ltd is based in Ontario, Canada. See the [About page](https://chartkit.io/about), [terms](https://chartkit.io/terms), and [privacy policy](https://chartkit.io/privacy) for company and product information. --- Source: https://chartkit.io/developers # Chart Kit Developer Guide Install React Native Chart Kit, test a chart, and read documentation through Markdown, the API, or the CLI. Last updated: September 6, 2026 ## When to use Chart Kit Use Chart Kit to add line, area, bar, pie, donut, progress, or contribution heatmap charts to a React Native app. It fits mobile dashboards, reports, trends, category comparisons, and activity screens. Use the modern API for new screens. Keep the root import when maintaining a legacy chart. Check the migration guide before changing an existing screen. Chart Kit renders charts locally in your app. The website provides documentation and live examples. The HTTP API below serves documentation. It does not accept chart data or render chart images. ## Quickstart ``` npm install react-native-chart-kit react-native-svg ``` Import modern components from `react-native-chart-kit/v2`. Follow the [installation guide](https://chartkit.io/docs/react-native/getting-started/installation) for the current React Native requirements and a complete first chart. The [line chart playground](https://chartkit.io/docs/react-native/charts/line) provides an interactive example where you can test chart properties in the browser. The public package uses the MIT license. Pro workflows use the separate `@chart-kit/pro` package. Read [Pro installation](https://chartkit.io/docs/react-native/charts/pro-installation) and [pricing](https://chartkit.io/docs/react-native/charts/pricing) before you select a commercial feature. ## Authentication and API keys Public documentation, Markdown files, and the documentation API need no authentication or API key. Installing the public library needs no Chart Kit account. Pro license terms apply to production use of Pro packages. A Pro license is separate from access to the public documentation API. ## Documentation API Use [GET /api/v1/docs](https://chartkit.io/api/v1/docs) to list the available paths. Use [GET /api/v1/docs/page?path=/docs/react-native/charts/line](https://chartkit.io/api/v1/docs/page?path=/docs/react-native/charts/line) to read one page as Markdown inside JSON. The [OpenAPI 3.1 specification](https://chartkit.io/openapi.json) defines unique operation IDs, parameters, and response schemas for function calling. ``` curl -H 'Accept: application/json' 'https://chartkit.io/api/v1/docs/page?path=/docs/react-native/charts/line' ``` The API supports GET and HEAD. Errors use JSON with `error.code`, `error.message`, and `error.hint`. A missing page returns 404. An invalid path parameter returns 400. An unsupported method returns 405. The API has no account quota. Cloudflare traffic protections can apply. Cache documentation in your client and avoid repeated bulk requests. ## Markdown and agent instructions Start with [llms.txt](https://chartkit.io/llms.txt) to select a task and a page. Read [agent-instructions.md](https://chartkit.io/agent-instructions.md) for package and licensing rules. Public pages support `Accept: text/markdown` and a `.md` URL. The homepage Markdown URL is [/index.md](https://chartkit.io/index.md). Use [llms-full.txt](https://chartkit.io/llms-full.txt) only when you need the full public content. ``` curl -H 'Accept: text/markdown' https://chartkit.io/docs/react-native/charts/line ``` ## Official CLI The `chart-kit` CLI ships in `react-native-chart-kit` from version 7.0.4. It reads the public documentation API and writes Markdown or JSON to standard output. It makes no changes to your app and needs no API key. ``` npx --package=react-native-chart-kit chart-kit docs /docs/react-native/charts/line ``` Use `chart-kit docs` to list pages, or add `--json` for structured output. Run `chart-kit --help` for examples. Failures write a JSON error to standard error and return a nonzero exit code. ## More resources Read the [documentation index](https://chartkit.io/docs/react-native), [migration guide](https://chartkit.io/docs/react-native/migration/from-v1), [troubleshooting guide](https://chartkit.io/docs/react-native/troubleshooting), and [contributor guide](https://chartkit.io/docs/react-native/getting-started/contributing). Browse the [public source](https://github.com/chart-kit/react-native-chart-kit) or [contact Chart Kit](https://chartkit.io/contact) for support. --- Source: https://chartkit.io/docs/react-native/charts/accessibility # Accessibility Every chart accepts `accessibilityLabel`. If no label is provided, the chart generates a concise screen-reader summary from its data. For richer app-level fallbacks, export table models with the helper matching the chart type: ```tsx import { getBarChartDataTable, getLineChartDataTable, getPieChartDataTable, getProgressChartDataTable, getContributionGraphDataTable } from "react-native-chart-kit/v2"; ``` These helpers return normalized rows and formatted values that can back a hidden native table, a visible details panel, export flow, or enterprise accessibility report. Summary helpers are also exported: - `getLineChartAccessibilitySummary()` - `getBarChartAccessibilitySummary()` - `getPieChartAccessibilitySummary()` - `getProgressChartAccessibilitySummary()` - `getContributionGraphAccessibilitySummary()` Use chart-level `formatXLabel`, `formatYLabel`, `formatValue`, or `formatPercentage` with these helpers so the accessibility output matches the visible chart labels. ## Table Fallback Recipe Use table fallbacks when a chart appears in a production screen where users may need exact values outside the visual chart. The helper output is intentionally data-only, so apps can render it as a visible details panel, a screen-reader-only region, an export source, or an enterprise accessibility report. ```tsx import { useMemo, useState } from "react"; import { Pressable, Text, View } from "react-native"; import { LineChart, getLineChartDataTable } from "react-native-chart-kit/v2"; const RevenueChartDetails = ({ data, width }) => { const [expanded, setExpanded] = useState(false); const table = useMemo( () => getLineChartDataTable({ data, xKey: "month", series: [{ yKey: "revenue", label: "Revenue" }], formatYLabel: (value) => `$${Math.round(value / 1000)}k` }), [data] ); return ( setExpanded((current) => !current)}> {expanded ? "Hide data table" : "Show data table"} {expanded ? ( {table.rows.map((row) => ( {row.xLabel}: {row.formattedValues.revenue} ))} ) : null} ); }; ``` The public package focuses on baseline chart summaries and data-table helpers. [Edit page](https://github.com/chart-kit/react-native-chart-kit/edit/main/docs/charts/accessibility.md) [Previous Themes](https://chartkit.io/docs/react-native/charts/themes/)[Next Troubleshooting](https://chartkit.io/docs/react-native/troubleshooting/) --- Source: https://chartkit.io/docs/react-native/charts/area # Area Chart `AreaChart` shows a trend with the area beneath the line filled in. Use it when the size of a value matters as much as its movement, such as balances, capacity, pipeline, or volume over time. ## Basic Area ```tsx import { AreaChart } from "react-native-chart-kit/v2"; const data = [ { date: "Jan 01", price: 72 }, { date: "Jan 03", price: 138 }, { date: "Jan 08", price: 91 }, { date: "Jan 15", price: 166 }, { date: "Jan 24", price: 118 }, { date: "Feb 01", price: 202 } ]; export function PipelineChart() { return ( ); } ``` ## Area Fill Use `areaFill` to tune fill opacity. You can also pass `area` to `LineChart` when a product uses line and area variants from the same component wrapper. ```tsx const data = [ { date: "Jan", price: 42 }, { date: "Feb", price: 96 }, { date: "Mar", price: 58 }, { date: "Apr", price: 132 }, { date: "May", price: 84 }, { date: "Jun", price: 158 } ]; ; ``` Use `areaFill` on the chart for a shared fill style, or per series when each series needs its own colors or opacity. ## Threshold Area Threshold coloring clips the rendered path and area fill above or below a y value. Raw points are unchanged. ```tsx const data = [ { month: "Jan", attainment: 62 }, { month: "Feb", attainment: 138 }, { month: "Mar", attainment: 74 }, { month: "Apr", attainment: 151 }, { month: "May", attainment: 89 }, { month: "Jun", attainment: 122 }, { month: "Jul", attainment: 55 }, { month: "Aug", attainment: 164 }, { month: "Sep", attainment: 96 }, { month: "Oct", attainment: 145 }, { month: "Nov", attainment: 78 }, { month: "Dec", attainment: 172 } ]; ; ``` ## Dense Area Charts For long time series, use the same viewport, scrolling, and decimation options as `LineChart`. ```tsx ``` ## Props ### AreaChart `AreaChart` accepts the same props as `LineChart` and renders with area fill enabled by default. | Prop | Type | Description | | --- | --- | --- | | `data` | `TData[]` | Object-row source data for the chart. | | `xKey` | `keyof TData` | Row key used for the x-axis value. | | `yKey` | `keyof TData` | Single row key used for y values when `series` or `yKeys` is not provided. | | `yKeys` | `Array` | Multiple row keys rendered as separate series with default styling. | | `series` | `LineChartSeries[]` | Full per-series configuration, including labels, colors, stroke, dots, thresholds, and area fill. | | `width` | `number` | Outer chart width in pixels. | | `height` | `number` | Outer chart height in pixels. | | `theme` | `ChartKitThemeMode` or `CartesianChartTheme` | Theme mode or inline theme tokens for this chart. | | `preset` | `CartesianChartPresetValue` | Built-in or registered preset name used to seed chart colors and typography. | | `scrollable` | `boolean` | Enables a horizontal scroll viewport for long data sets. | | `visiblePoints` | `number` | Number of points visible in the viewport when `scrollable` is enabled. | | `initialIndex` | `ChartViewportInitialIndex` | Initial scroll/window position, such as `"start"` or `"end"`. | | `viewport` | `LineChartViewportConfig` | Controlled visible data window for scroll, pan, zoom, or range selector flows. | | `onViewportChange` | `(event) => void` | Called when viewport state changes from the main plot or range selector. | | `viewportInteraction` | `boolean` or `LineChartViewportInteractionConfig` | Enables and configures one-finger pan and pinch zoom for the viewport. | | `rangeSelector` | `boolean` or `LineChartRangeSelectorConfig` | Adds a mini-chart range selector below the main plot. | | `decimation` | `false`, `"auto"`, `number`, or `LineChartDecimationConfig` | Controls rendered path simplification for dense series. | | `curve` | `LineCurve` | Curve interpolation used for line and area paths. | | `connectNulls` | `boolean` | Connects defined points across `null` or missing y values. | | `area` | `boolean` | Inherited from `LineChartProps`; `AreaChart` renders with area fill enabled. | | `areaFill` | `LineChartAreaFillConfig` | Shared area fill opacity, gradient, or color configuration. | | `showDots` | `boolean` | Shows or hides all point markers. | | `dots` | `boolean` or `LineChartDotConfig` | Configures default point marker visibility, size, shape, and color. | | `renderDot` | `(props) => ReactNode` | Custom renderer for ordinary point markers. | | `selectedIndex` | `number` | Controlled selected data index. | | `defaultSelectedIndex` | `number` | Initial uncontrolled selected data index. | | `activeDot` | `boolean` or `LineChartDotConfig` | Configures the marker shown for the selected point. | | `renderActiveDot` | `(props) => ReactNode` | Custom renderer for the selected point marker. | | `interaction` | `LineChartInteraction` | Selection/scrub interaction mode and callbacks. | | `crosshair` | `boolean` or `LineChartCrosshairConfig` | Shows and configures the selected-point crosshair. | | `renderCrosshair` | `(props) => ReactNode` | Custom renderer for the crosshair. | | `tooltip` | `boolean` or `LineChartTooltipConfig` | Shows and configures selected-point tooltip content and placement. | | `renderTooltip` | `(props) => ReactNode` | Custom renderer for selected-point tooltip content. | | `referenceLines` | `LineChartReferenceLineConfig[]` | Horizontal reference lines drawn across the plot. Reference labels support `labelContainer`. | | `referenceBands` | `LineChartReferenceBandConfig[]` | Horizontal reference bands drawn behind the series. Reference labels support `labelContainer`. | | `showHorizontalGridLines` | `boolean` | Shows or hides horizontal grid lines. | | `showVerticalGridLines` | `boolean` | Shows or hides vertical grid lines. | | `legend` | `boolean` or `LineChartLegendConfig` | Shows and configures the chart legend. | | `labelStrategy` | `LineChartLabelStrategy` | Controls x-axis label density and layout. | | `labelRotation` | `number` | Rotation angle for x-axis labels when using rotated labels. | | `labelMinGap` | `number` | Minimum gap used by automatic x-axis label skipping. | | `edgeLabelPolicy` | `LineChartEdgeLabelPolicy` | Controls how first and last x-axis labels are shifted, hidden, or shown. | | `yDomain` | `NumericDomainInput` | Overrides or constrains the computed y-axis domain. | | `yAxisLabelWidth` | `LineChartYAxisLabelWidth` | Fixed, automatic, or stable width for y-axis labels. | | `axisLabelAnimation` | `boolean` or `LineChartAxisLabelAnimationConfig` | Animates y-axis label changes during viewport updates. | | `formatXLabel` | `(value, index) => string` | Formats x-axis labels and selected x labels. | | `formatYLabel` | `(value) => string` | Formats y-axis labels, selected values, and tooltip values. | | `renderer` | `LineChartRenderer` | Renderer implementation used for SVG-compatible primitives. | | `id` | `string` | Stable chart id used for internal ids and coordinated selection scope. | | `debugLayout` | `boolean` | Renders layout debug rectangles in development. | | `onLayoutDebug` | `(model) => void` | Receives computed layout debug geometry. | | `accessibilityLabel` | `string` | Overrides the generated accessible chart summary. | | `testID` | `string` | Test identifier applied to the chart container. | [Edit page](https://github.com/chart-kit/react-native-chart-kit/edit/main/docs/charts/area.md) [Previous Line Chart](https://chartkit.io/docs/react-native/charts/line/)[Next Bar Charts](https://chartkit.io/docs/react-native/charts/bar/) --- Source: https://chartkit.io/docs/react-native/charts/bar # Bar Charts `BarChart` compares values across categories or time buckets. Use it for rankings, monthly totals, grouped series, stacked composition, negative values, and horizontal layouts when category labels need more room. ## Basic Bars ```tsx import { BarChart } from "react-native-chart-kit/v2"; const data = [ { month: "Jan", signups: 180 }, { month: "Feb", signups: 520 }, { month: "Mar", signups: 260 }, { month: "Apr", signups: 740 }, { month: "May", signups: 390 }, { month: "Jun", signups: 860 } ]; export function SignupsChart() { return ( ); } ``` ## Grouped Bars Use `series` for multiple bars per x value. The chart shows a bottom legend by default when there is more than one series. ```tsx const data = [ { month: "Jan", organic: 28, paid: 62 }, { month: "Feb", organic: 74, paid: 34 }, { month: "Mar", organic: 39, paid: 88 }, { month: "Apr", organic: 96, paid: 41 }, { month: "May", organic: 54, paid: 103 }, { month: "Jun", organic: 118, paid: 58 } ]; ; ``` Useful grouped-bar props: - `barWidthRatio`: controls how much of each x band is filled by bars. - `barGapRatio`: controls spacing between bars inside a group. - `barRadius`: controls corner radius. - `legend={false}`: hides the default legend. ## Negative Values Negative values render below the zero baseline. Keep `yDomain` on its default include-zero behavior unless you intentionally want a cropped baseline. ```tsx const profit = [ { month: "Jan", profit: 38 }, { month: "Feb", profit: -28 }, { month: "Mar", profit: 64 }, { month: "Apr", profit: -42 }, { month: "May", profit: 81 }, { month: "Jun", profit: -18 } ]; (value < 0 ? `-$${Math.abs(value)}k` : `$${value}k`)} width={410} height={250} />; ``` ## Horizontal Bars Set `orientation="horizontal"` when category labels are easier to scan down the left axis. ```tsx const supportVolume = [ { channel: "Chat", tickets: 95 }, { channel: "Email", tickets: 37 }, { channel: "Phone", tickets: 68 }, { channel: "Social", tickets: 24 }, { channel: "Community", tickets: 113 } ]; ; ``` Horizontal bars support grouped, stacked, 100% stacked, and negative values through the same `mode`, `series`, and `yDomain` props as vertical bars. ## Stacked Bars Set `mode="stacked"` to stack series by row. Positive and negative stacks are tracked separately from the zero baseline. ```tsx const data = [ { month: "Jan", newCustomers: 180, expansion: 60 }, { month: "Feb", newCustomers: 520, expansion: 210 }, { month: "Mar", newCustomers: 260, expansion: 120 }, { month: "Apr", newCustomers: 740, expansion: 330 }, { month: "May", newCustomers: 390, expansion: 170 }, { month: "Jun", newCustomers: 860, expansion: 410 } ]; ; ``` ## 100% Stacked Bars Set `mode="stacked100"` for percentage composition. The original values are preserved in the bar model while rendered heights are normalized to row totals. ```tsx const platformShare = [ { month: "Jan", ios: 62, android: 25, web: 13 }, { month: "Feb", ios: 38, android: 47, web: 15 }, { month: "Mar", ios: 55, android: 21, web: 24 }, { month: "Apr", ios: 29, android: 58, web: 13 }, { month: "May", ios: 68, android: 19, web: 13 }, { month: "Jun", ios: 44, android: 31, web: 25 } ]; `${value}%`} width={410} height={250} />; ``` ## Tap Selection And Tooltips Bar selection is opt-in. Use `interaction="tap"` for the simplest behavior, or pass an object when you need callbacks or outside-press dismissal. ```tsx const data = [ { month: "Jan", organic: 28, paid: 62 }, { month: "Feb", organic: 74, paid: 34 }, { month: "Mar", organic: 39, paid: 88 }, { month: "Apr", organic: 96, paid: 41 }, { month: "May", organic: 54, paid: 103 }, { month: "Jun", organic: 118, paid: 58 } ]; { setSelectedChannel(event.seriesLabel); } }} tooltip={{ anchor: "pointer", placement: "above", width: 132 }} defaultSelectedBar={{ dataIndex: 3, seriesKey: "paid" }} width={410} height={260} />; ``` The public select event includes `dataIndex`, `seriesKey`, `seriesLabel`, `value`, `formattedValue`, `x`, `xLabel`, `color`, `position`, and the original `raw` row. Tooltip positioning uses `anchor: "bar"` and `placement: "auto"` by default. Use `anchor: "pointer"` with `placement: "above"` when the tooltip should follow the tap position and stay above the finger. Styling follows the chart theme tooltip tokens by default and can be overridden per chart with `backgroundColor`, `borderColor`, `textColor`, `labelColor`, `padding`, `borderRadius`, `fontFamily`, `fontSize`, `labelFontSize`, and shadow props. ## Scrollable Bars Use `scrollable`, `visiblePoints`, and `initialIndex` for long categorical bar charts. For bars, `visiblePoints` maps to visible bar bands. ```tsx const weeklySpend = [ { week: "W1", spend: 18 }, { week: "W2", spend: 52 }, { week: "W3", spend: 26 }, { week: "W4", spend: 74 }, { week: "W5", spend: 31 }, { week: "W6", spend: 88 }, { week: "W7", spend: 43 }, { week: "W8", spend: 96 }, { week: "W9", spend: 39 }, { week: "W10", spend: 108 }, { week: "W11", spend: 57 }, { week: "W12", spend: 121 }, { week: "W13", spend: 44 }, { week: "W14", spend: 132 }, { week: "W15", spend: 63 }, { week: "W16", spend: 118 }, { week: "W17", spend: 71 }, { week: "W18", spend: 146 } ]; `$${value}k`} width={410} height={250} />; ``` The y-axis labels stay pinned while the bars and x-axis labels scroll horizontally. ## Custom Bar Rendering Use `renderBar` when bars need product-specific styling while keeping the built-in layout, selection, hit testing, labels, sticky axes, and tooltips. ```tsx import { Rect } from "react-native-svg"; const weeklySpend = [ { week: "W1", spend: 18 }, { week: "W2", spend: 52 }, { week: "W3", spend: 26 }, { week: "W4", spend: 74 }, { week: "W5", spend: 31 }, { week: "W6", spend: 88 }, { week: "W7", spend: 43 }, { week: "W8", spend: 96 } ]; ( )} />; ``` ## Labels and Themes Useful label and theme props: - `labelStrategy`: `auto`, `show`, or `hide`. - `formatXLabel`: formats x-axis labels. - `formatYLabel`: formats y-axis and value labels. - `showHorizontalGridLines`: enabled by default. - `showXAxisLabels` / `showYAxisLabels`: hide axis label groups without removing grid geometry. - `yTickCount`: controls y-axis tick density. - `preset`: uses the same cartesian presets as LineChart. - `theme`: overrides chart colors, plot background, text, typography, and series colors. ## Props ### BarChart | Prop | Type | Description | | --- | --- | --- | | `data` | `TData[]` | Object-row source data for the chart. | | `xKey` | `keyof TData` | Row key used for category, date, or numeric x values. | | `yKey` | `keyof TData` | Single row key used for bar values when `series` or `yKeys` is not provided. | | `yKeys` | `Array` | Multiple row keys rendered as grouped or stacked series with default styling. | | `series` | `BarChartSeries[]` | Full per-series configuration, including y key, label, key, and color. | | `width` | `number` | Outer chart width in pixels. | | `height` | `number` | Outer chart height in pixels. | | `theme` | `ChartKitThemeMode` or `CartesianChartTheme` | Theme mode or inline theme tokens for this chart. | | `preset` | `CartesianChartPresetValue` | Built-in or registered preset name used to seed chart colors and typography. | | `scrollable` | `boolean` | Enables a horizontal scroll viewport for long bar sets. | | `visiblePoints` | `number` | Number of x values visible in the viewport when `scrollable` is enabled. | | `initialIndex` | `ChartViewportInitialIndex` | Initial scroll position, such as `"start"` or `"end"`. | | `orientation` | `BarChartOrientation` | Renders vertical or horizontal bars. | | `mode` | `BarChartMode` | Chooses grouped, stacked, or 100% stacked layout. | | `yDomain` | `NumericDomainInput` | Overrides or constrains the computed value-axis domain. | | `barRadius` | `number` | Corner radius applied to rendered bars. | | `barWidthRatio` | `number` | Portion of each category slot occupied by bars. | | `barGapRatio` | `number` | Relative gap between grouped bars. | | `showValuesOnTopOfBars` | `boolean` | Shows formatted value labels at bar ends. | | `showHorizontalGridLines` | `boolean` | Shows or hides horizontal grid lines. | | `showXAxisLabels` | `boolean` | Shows or hides x-axis labels. | | `showYAxisLabels` | `boolean` | Shows or hides y-axis labels. | | `yTickCount` | `number` | Number of ticks used for value-axis labels and grid lines. | | `legend` | `boolean` | Shows or hides the bottom legend. | | `interaction` | `BarChartInteraction` | Tap selection mode and callbacks. | | `selectedBar` | `BarChartSelectedBar` | Controlled selected bar by data index and series key. | | `defaultSelectedBar` | `BarChartSelectedBar` | Initial uncontrolled selected bar. | | `selectionAnimation` | `boolean` or `BarChartSelectionAnimationConfig` | Enables and configures selected-bar animation. | | `tooltip` | `boolean` or `BarChartTooltipConfig` | Shows and configures selected-bar tooltip content and placement. | | `renderBar` | `(props) => ReactNode` | Custom renderer for each bar while preserving layout and hit testing. | | `renderer` | `BarChartRenderer` | Renderer implementation used for SVG-compatible primitives. | | `labelStrategy` | `BarChartLabelStrategy` | Controls x-axis label visibility. | | `formatXLabel` | `(value, index) => string` | Formats x-axis labels and selected x labels. | | `formatYLabel` | `(value) => string` | Formats y-axis labels, value labels, and tooltip values. | | `id` | `string` | Stable chart id used for coordinated selection scope. | | `accessibilityLabel` | `string` | Overrides the generated accessible chart summary. | | `testID` | `string` | Test identifier applied to the chart container. | [Edit page](https://github.com/chart-kit/react-native-chart-kit/edit/main/docs/charts/bar.md) [Previous Area Chart](https://chartkit.io/docs/react-native/charts/area/)[Next Pie Chart](https://chartkit.io/docs/react-native/charts/pie/) --- Source: https://chartkit.io/docs/react-native/charts/candlebar # Candlebar Chart `CandlebarChart` shows open, high, low, close, and volume data for each interval. Use it for market, trading, and asset-monitoring screens where users need to inspect price movement candle by candle. This chart is available in Chart Kit Pro. Install it once from [Installation](https://chartkit.io/docs/react-native/charts/pro-installation/). ## Crosshair Inspector Use crosshair inspection when the selected candle drives UI outside the chart. Keep the selected index controlled, update it from `interaction.onSelect`, and render the OHLCV readout wherever it fits your screen. The crosshair stays under the user’s finger while a separate candle marker shows which candle is selected. Use a controlled viewport with `onViewportChange` when the mini range selector needs to move or resize the visible interval. ```tsx import { useState } from "react"; import { Text, View } from "react-native"; import { resolveCartesianChartThemeConfig, useChartKitTheme } from "react-native-chart-kit/v2"; import type { CandlestickChartViewportConfig } from "@chart-kit/pro"; import { CandlebarChart } from "@chart-kit/pro"; const candles = Array.from({ length: 40 }, (_, index) => { const open = 184 + Math.sin(index * 0.55) * 6 + index * 1.4; const move = Math.cos(index * 0.75) * 7; const close = open + move; const wick = 3 + Math.abs(move) * 0.35; return { time: `T${index + 1}`, open, high: Math.max(open, close) + wick, low: Math.min(open, close) - wick, close, volume: Math.round(48 + Math.abs(move) * 9 + index * 3) }; }); const formatValue = (value: number) => value.toFixed(1); const formatSignedValue = (value: number) => `${value >= 0 ? "+" : ""}${formatValue(value)}`; export function CrosshairInspector() { const chartTheme = useChartKitTheme(); const [selectedIndex, setSelectedIndex] = useState(24); const [viewport, setViewport] = useState({ startIndex: 6, endIndex: 35 }); const selected = candles[selectedIndex] ?? candles[candles.length - 1]!; const resolvedTheme = resolveCartesianChartThemeConfig({ mode: chartTheme.mode, preset: chartTheme.preset, presets: chartTheme.presets, theme: chartTheme.theme }); const isUp = selected.close >= selected.open; const upColor = resolvedTheme.series[1] ?? (chartTheme.mode === "dark" ? "#22c55e" : "#16a34a"); const downColor = resolvedTheme.series[3] ?? (chartTheme.mode === "dark" ? "#f59e0b" : "#dc2626"); const directionColor = isUp ? upColor : downColor; const change = selected.close - selected.open; const metrics = [ ["O", formatValue(selected.open)], ["H", formatValue(selected.high)], ["L", formatValue(selected.low)], ["C", formatValue(selected.close)], ["VOL", String(selected.volume)] ] as const; return ( {selected.time} {formatValue(selected.close)} {formatSignedValue(change)} {metrics.map(([label, value], index) => ( {label} {value} ))} setSelectedIndex(event.dataIndex) }} rangeSelector={{ visible: true, height: 70 }} viewport={viewport} onViewportChange={(event) => setViewport(event.viewport)} selectedIndex={selectedIndex} selectionPriceLabel showHorizontalGridLines showYAxisLabels tooltip={false} width={410} yTickCount={4} /> ); } ``` ## OHLC and Volume ```tsx import { CandlebarChart } from "@chart-kit/pro"; const candles = Array.from({ length: 20 }, (_, index) => { const open = 184 + Math.sin(index * 0.55) * 6 + index * 2.4; const move = Math.cos(index * 0.75) * 7; const close = open + move; const wick = 3 + Math.abs(move) * 0.35; return { date: `T${index + 1}`, open, high: Math.max(open, close) + wick, low: Math.min(open, close) - wick, close, volume: Math.round(48 + Math.abs(move) * 9 + index * 3) }; }); export function TradingSession() { return ( ); } ``` ## Realtime Updates Use realtime updates when the latest interval is still open. Keep the candle array in state, replace the active candle as ticks arrive, and append a new candle when the interval closes. ```tsx import { useEffect, useMemo, useState } from "react"; import { Text, View } from "react-native"; import { resolveCartesianChartThemeConfig, useChartKitTheme } from "react-native-chart-kit/v2"; import { CandlebarChart } from "@chart-kit/pro"; type Candle = { slot: number; time: string; open: number; high: number; low: number; close: number; volume: number; }; const intervalMs = 1000; const visiblePoints = 24; const ticksPerCandle = 6; const seedCandles: Candle[] = Array.from( { length: visiblePoints }, (_, index) => { const open = 180 + Math.sin(index * 0.7) * 5 + index * 0.8; const move = Math.cos(index * 0.55) * 4; const close = open + move; const wick = 2 + Math.abs(move) * 0.4; return { slot: index, time: `T${index + 1}`, open, high: Math.max(open, close) + wick, low: Math.min(open, close) - wick, close, volume: Math.round(50 + Math.abs(move) * 9) }; } ); const formatValue = (value: number) => value.toFixed(1); const formatSignedValue = (value: number) => `${value >= 0 ? "+" : ""}${formatValue(value)}`; const appendCandle = (candles: Candle[], sequence: number): Candle[] => { const previous = candles[candles.length - 1]!; const open = previous.close; const move = Math.sin(sequence * 0.8) * 4 + Math.cos(sequence * 0.34) * 2; const close = open + move; const wick = 2 + Math.abs(move) * 0.35; return [ ...candles, { slot: sequence, time: `T${sequence + 1}`, open, high: Math.max(open, close) + wick, low: Math.min(open, close) - wick, close, volume: Math.round(55 + Math.abs(move) * 10) } ]; }; const updateOpenCandle = (candle: Candle, liveStep: number): Candle => { const move = Math.sin(liveStep * 0.9) * 1.4 + Math.cos(liveStep * 0.35); const close = candle.close + move; return { ...candle, close, high: Math.max(candle.high, close + Math.abs(move) * 0.5), low: Math.min(candle.low, close - Math.abs(move) * 0.5), volume: candle.volume + Math.round(2 + Math.abs(move) * 3) }; }; const createLiveCandles = (liveStep: number): Candle[] => { const closedCandleCount = Math.floor(liveStep / ticksPerCandle); let candles = seedCandles.map((candle) => ({ ...candle })); for (let index = 0; index < closedCandleCount; index += 1) { candles = appendCandle(candles, visiblePoints + index); } const last = candles[candles.length - 1]!; candles[candles.length - 1] = updateOpenCandle(last, liveStep); return candles.slice(-visiblePoints); }; export function RealtimeCandleUpdates() { const chartTheme = useChartKitTheme(); const [liveStep, setLiveStep] = useState(0); useEffect(() => { const intervalId = setInterval(() => { setLiveStep((current) => current + 1); }, intervalMs); return () => clearInterval(intervalId); }, []); const candles = useMemo(() => createLiveCandles(liveStep), [liveStep]); const latest = candles[candles.length - 1]!; const resolvedTheme = resolveCartesianChartThemeConfig({ mode: chartTheme.mode, preset: chartTheme.preset, presets: chartTheme.presets, theme: chartTheme.theme }); const isUp = latest.close >= latest.open; const upColor = resolvedTheme.series[1] ?? (chartTheme.mode === "dark" ? "#22c55e" : "#16a34a"); const downColor = resolvedTheme.series[3] ?? (chartTheme.mode === "dark" ? "#f59e0b" : "#dc2626"); const directionColor = isUp ? upColor : downColor; const change = latest.close - latest.open; const metrics = [ ["O", formatValue(latest.open)], ["H", formatValue(latest.high)], ["L", formatValue(latest.low)], ["C", formatValue(latest.close)], ["VOL", String(latest.volume)] ] as const; return ( {latest.time} {formatValue(latest.close)} {formatSignedValue(change)} {metrics.map(([label, value], index) => ( {label} {value} ))} Live ); } ``` In production, replace `createLiveCandles()` with your websocket, stream, or polling adapter. ## Product Use Cases Use Candlebar charts for stocks, crypto, commodities, FX, embedded broker flows, portfolio analytics, and any screen where users need to inspect price movement without leaving the mobile app. ## Props | Prop | Type | Description | | --- | --- | --- | | `data` | `TData[]` | Object-row OHLC source data. | | `dateKey` | `keyof TData` | Row key used for x-axis labels and selected candle labels. | | `openKey` | `keyof TData` | Row key used for opening values. | | `highKey` | `keyof TData` | Row key used for high wick values. | | `lowKey` | `keyof TData` | Row key used for low wick values. | | `closeKey` | `keyof TData` | Row key used for closing values. | | `volumeKey` | `keyof TData` | Optional row key used for volume bars. | | `defaultSelectedIndex` | `number` | Initial selected candle index. | | `selectedIndex` | `number` | Controlled selected candle index for external inspectors. | | `interaction` | `object` | Enables tap or crosshair selection and gesture callbacks. | | `viewport` | `object` | Controlled visible candle range. | | `onViewportChange` | `(event) => void` | Called when the visible range changes. | | `rangeSelector` | `boolean` or `object` | Shows and configures the mini range selector. | | `viewportInteraction` | `boolean` or `object` | Enables pan/zoom viewport gestures. | | `width` | `number` | Outer chart width in pixels. | | `height` | `number` | Outer chart height in pixels. | [Edit page](https://github.com/chart-kit/react-native-chart-kit/edit/main/docs/charts/candlebar.md) [Previous Installation](https://chartkit.io/docs/react-native/charts/pro-installation/)[Next Radar Chart](https://chartkit.io/docs/react-native/charts/radar/) --- Source: https://chartkit.io/docs/react-native/charts/combo # Combo Chart `ComboChart` combines bars and lines in one chart. Use it for dashboards where a current value, target, forecast, margin, or rate should be inspected together on the same timeline. This chart is available in Chart Kit Pro. Install it once from [Installation](https://chartkit.io/docs/react-native/charts/pro-installation/). ## Revenue Operating View Use a basic combo when the bar series explain the current month and the line series gives the surrounding target or forecast. ```tsx import { ComboChart } from "@chart-kit/pro"; const money = (value: number) => `$${Math.round(value)}k`; const data = [ { month: "Jan", revenue: 420, forecast: 480, margin: 128 }, { month: "Feb", revenue: 560, forecast: 530, margin: 168 }, { month: "Mar", revenue: 490, forecast: 610, margin: 151 }, { month: "Apr", revenue: 720, forecast: 690, margin: 214 }, { month: "May", revenue: 640, forecast: 760, margin: 193 }, { month: "Jun", revenue: 880, forecast: 840, margin: 276 }, { month: "Jul", revenue: 790, forecast: 920, margin: 244 }, { month: "Aug", revenue: 1040, forecast: 980, margin: 331 } ]; export function RevenueOperations() { return ( ); } ``` ## Shared Tooltip Use a persistent selected index when the chart should open with a meaningful month already inspected. `interaction="tap"` keeps the shared tooltip aligned with the selected x value. ```tsx import { ComboChart } from "@chart-kit/pro"; const money = (value: number) => `$${Math.round(value)}k`; const bookings = [ { month: "Jan", booked: 118, target: 132 }, { month: "Feb", booked: 146, target: 140 }, { month: "Mar", booked: 182, target: 168 }, { month: "Apr", booked: 208, target: 196 }, { month: "May", booked: 236, target: 224 }, { month: "Jun", booked: 274, target: 252 } ]; export function PipelineInspection() { return ( ); } ``` ## Series Toggles Keep series visibility in product state when the chart is part of broader dashboard controls. The chart keeps the remaining bars and lines aligned to the same x-axis. ```tsx import { useState } from "react"; import { Pressable, Text, View } from "react-native"; import { ComboChart } from "@chart-kit/pro"; import { resolveCartesianChartThemeConfig, useChartKitTheme } from "react-native-chart-kit/v2"; const money = (value: number) => `$${Math.round(value)}k`; const percent = (value: number) => `${Math.round(value)}%`; const channelPlan = [ { month: "Jan", direct: 44, enterprise: 128, margin: 17 }, { month: "Feb", direct: 52, enterprise: 154, margin: 19 }, { month: "Mar", direct: 58, enterprise: 178, margin: 21 }, { month: "Apr", direct: 66, enterprise: 204, margin: 24 }, { month: "May", direct: 72, enterprise: 224, margin: 27 }, { month: "Jun", direct: 80, enterprise: 252, margin: 30 } ]; const toggleItems = [ { key: "bar-direct", label: "Direct" }, { key: "bar-enterprise", label: "Enterprise" }, { key: "line-margin", label: "Margin" } ]; const colorWithAlpha = (color: string, alpha: string) => color.startsWith("#") && color.length === 7 ? `${color}${alpha}` : color; export function ChannelPlan() { const [visibleSeriesKeys, setVisibleSeriesKeys] = useState( toggleItems.map((item) => item.key) ); const chartKitTheme = useChartKitTheme(); const resolvedTheme = resolveCartesianChartThemeConfig({ mode: chartKitTheme.mode, preset: chartKitTheme.preset, presets: chartKitTheme.presets, theme: chartKitTheme.theme }); const isLight = chartKitTheme.mode === "light"; const toggleSeries = (key: string) => { setVisibleSeriesKeys((currentKeys) => { const nextKeys = currentKeys.includes(key) ? currentKeys.filter((item) => item !== key) : [...currentKeys, key]; return nextKeys.length > 0 ? nextKeys : currentKeys; }); }; const seriesToggles = toggleItems.map((item, index) => ({ ...item, color: resolvedTheme.series[index] ?? "#2563eb" })); return ( {seriesToggles.map((item) => { const active = visibleSeriesKeys.includes(item.key); return ( toggleSeries(item.key)} style={{ alignItems: "center", display: "flex", backgroundColor: active ? colorWithAlpha(item.color, isLight ? "10" : "18") : "transparent", borderColor: active ? item.color : "transparent", borderRadius: 999, borderWidth: 1, flexDirection: "row", gap: 5, height: 28, justifyContent: "center", minWidth: 88, paddingHorizontal: 11 }} > {item.label} ); })} (value > 40 ? money(value) : percent(value))} visibleSeriesKeys={visibleSeriesKeys} width={410} height={292} /> ); } ``` ## Negative Domain Use an explicit y-domain when the bar series can cross zero. The line still shares the same selected x value, so recovery screens can show whether a leading indicator is improving before the bar metric turns positive. ```tsx import { ComboChart } from "@chart-kit/pro"; const signedMoney = (value: number) => value < 0 ? `-$${Math.abs(Math.round(value))}k` : `$${Math.round(value)}k`; const recovery = [ { month: "Jan", profit: -22, cashFlow: 8 }, { month: "Feb", profit: -8, cashFlow: 12 }, { month: "Mar", profit: 14, cashFlow: 16 }, { month: "Apr", profit: 32, cashFlow: 20 }, { month: "May", profit: 48, cashFlow: 24 }, { month: "Jun", profit: 38, cashFlow: 22 } ]; export function ProfitRecovery() { return ( ); } ``` ## Product Use Cases Use Combo charts for revenue vs forecast, spend vs acquisition, active users vs conversion, inventory vs sell-through, channel plan controls, and operational dashboards where one metric explains another. ## Props | Prop | Type | Description | | --- | --- | --- | | `data` | `TData[]` | Object-row source data. | | `xKey` | `keyof TData` | Row key used for x-axis labels. | | `series` | `ComboChartSeries[]` | Mixed `bar` and `line` series configuration. | | `series[].key` | `string` | Stable id used by visibility and selection state. | | `visibleSeriesKeys` | `string[]` | Optional list of series keys to render. | | `selectedIndex` | `number` | Controlled selected x value. | | `defaultSelectedIndex` | `number` | Initial selected x value. | | `interaction` | `"tap"`, `"none"`, or object | Selection mode and callbacks. | | `tooltip` | `boolean` or object | Shows and configures the shared tooltip. | | `yDomain` | `object` or tuple | Overrides or constrains the computed y-domain. | | `formatYLabel` | `(value) => string` | Formats y-axis and tooltip values. | | `width` | `number` | Outer chart width in pixels. | | `height` | `number` | Outer chart height in pixels. | [Edit page](https://github.com/chart-kit/react-native-chart-kit/edit/main/docs/charts/combo.md) [Previous Realtime Bar Chart](https://chartkit.io/docs/react-native/charts/realtime/)[Next Export APIs](https://chartkit.io/docs/react-native/charts/export/) --- Source: https://chartkit.io/docs/react-native/charts/contribution-heatmap # Contribution Heatmaps `ContributionGraph` and `CalendarHeatmap` show activity intensity across a calendar grid. Use them for usage streaks, daily habits, contribution history, or any date-based metric where consistency over time matters. ```tsx import { ContributionGraph } from "react-native-chart-kit/v2"; const endDate = "2026-05-03"; const numDays = 154; const values = Array.from({ length: numDays }, (_, index) => { const end = new Date(`${endDate}T00:00:00.000Z`); const date = new Date( end.valueOf() - (numDays - 1 - index) * 24 * 60 * 60 * 1000 ); const weekday = date.getUTCDay(); const cycle = (index * 7 + weekday * 3) % 17; const launchWeekBoost = index > 110 && index < 126 ? 8 : 0; const weekendDip = weekday === 0 || weekday === 6 ? -4 : 0; return { date: date.toISOString().slice(0, 10), count: Math.max(0, cycle + launchWeekBoost + weekendDip) }; }); ; ``` ## Custom Color Scale ```tsx ``` Use `onDayPress` to connect cells to native tooltips, bottom sheets, or app-level detail panels. ## Empty Ranges An empty `values` array still renders the requested date range as zero-count cells. This keeps loading, quiet-period, and newly created workspace states visually stable. ```tsx ``` ## Props ### ContributionGraph / CalendarHeatmap `CalendarHeatmap` is exported as an alias of `ContributionGraph` and accepts the same props. | Prop | Type | Description | | --- | --- | --- | | `values` | `TData[]` | Source contribution rows. | | `endDate` | `string`, `number`, or `Date` | Last date included in the rendered range. | | `numDays` | `number` | Number of days to render, counting backward from `endDate`. | | `width` | `number` | Outer chart width in pixels. | | `height` | `number` | Outer chart height in pixels. | | `accessor` | `keyof TData` | Row key used for contribution values when not using the default `count`. | | `cellSize` | `number` | Size of each day cell in pixels. | | `gutterSize` | `number` | Gap between day cells in pixels. | | `weekStartsOn` | `number` | First day of the week, where `0` is Sunday and `1` is Monday. | | `showMonthLabels` | `boolean` | Shows or hides month labels above the heatmap. | | `showWeekdayLabels` | `boolean` | Shows or hides weekday labels beside the heatmap. | | `showOutOfRangeDays` | `boolean` | Renders calendar cells outside the requested date range. | | `theme` | `"light"`, `"dark"`, `"system"`, or `CartesianChartTheme` | Theme mode or inline theme tokens for this chart. | | `preset` | `CartesianChartPresetValue` | Built-in or registered preset name used to seed chart colors and typography. | | `colors` | `string[]` | Color scale used for non-empty contribution values. | | `emptyColor` | `string` | Fill color used for zero or missing values. | | `colorForValue` | `(props) => string` | Custom color resolver for each rendered cell. | | `getMonthLabel` | `(monthIndex, date) => string` | Custom month label formatter. | | `getWeekdayLabel` | `(dayIndex) => string` | Custom weekday label formatter. | | `onDayPress` | `(event) => void` | Called when a day cell is pressed. | | `renderer` | `ContributionGraphRenderer` | Renderer implementation used for SVG-compatible primitives. | | `accessibilityLabel` | `string` | Overrides the generated accessible chart summary. | | `testID` | `string` | Test identifier applied to the chart container. | [Edit page](https://github.com/chart-kit/react-native-chart-kit/edit/main/docs/charts/contribution-heatmap.md) [Previous Progress Charts](https://chartkit.io/docs/react-native/charts/progress/)[Next Legacy Charts](https://chartkit.io/docs/react-native/charts/legacy/) --- Source: https://chartkit.io/docs/react-native/charts/donut # Donut Chart `DonutChart` shows proportional slices around a center label. Use it for compact mixes, totals, or status summaries where the middle of the chart can carry a key number or selected category. ## Basic Donut ```tsx import { DonutChart } from "react-native-chart-kit/v2"; const revenueMix = [ { plan: "Enterprise", revenue: 680 }, { plan: "Business", revenue: 420 }, { plan: "Teams", revenue: 260 }, { plan: "Starter", revenue: 140 } ]; ; ``` ## Capabilities `DonutChart` supports: - object-row data - theme and preset colors - bottom wrapped legend - percentage labels in the legend - donut center text - rich custom center labels - custom legend item rendering - slice separators - tap selection with active-slice highlighting - zero and invalid slices without broken paths ## Tap Selection Use `interaction="tap"` for uncontrolled selection, or pass `selectedIndex` with `interaction.onSelect` for controlled product UI. ```tsx const revenueMix = [ { plan: "Enterprise", revenue: 680 }, { plan: "Business", revenue: 420 }, { plan: "Teams", revenue: 260 }, { plan: "Starter", revenue: 140 } ]; const [selectedIndex, setSelectedIndex] = useState(0); setSelectedIndex(event.index) }} centerLabel={revenueMix[selectedIndex]?.plan} activeSlice={{ inactiveOpacity: 0.36, strokeWidth: 4 }} width={410} height={260} />; ``` ## Custom Legend and Center Label Use `legend.renderItem` when the default compact legend is not enough. `centerLabel` can return React content for multi-line KPI labels. ```tsx const retentionSegments = [ { status: "Expanded annual contracts", accounts: 48 }, { status: "Renewed monthly workspaces", accounts: 32 }, { status: "At-risk accounts under review", accounts: 14 }, { status: "Paused or dormant teams", accounts: 6 }, { status: "Zero usage migrations", accounts: 0 } ]; ( {total} accounts )} sliceSeparator={{ width: 2 }} legend={{ itemGap: 8, maxItemWidth: "100%", reservedHeight: 104, renderItem: ({ item, theme }) => ( {item.label} {item.percentageLabel} ) }} width={410} height={320} />; ``` ## Props ### DonutChart `DonutChart` accepts the same props as `PieChart` and defaults `innerRadiusRatio` to `0.58`. | Prop | Type | Description | | --- | --- | --- | | `data` | `TData[]` | Object-row source data for the chart. | | `valueKey` | `keyof TData` | Row key used for slice values. | | `labelKey` | `keyof TData` | Row key used for slice and legend labels. | | `colorKey` | `keyof TData` | Row key used for per-slice colors. | | `colors` | `string[]` | Fallback color palette used when `colorKey` is not provided. | | `width` | `number` | Outer chart width in pixels. | | `height` | `number` | Outer chart height in pixels. | | `theme` | `"light"`, `"dark"`, `"system"`, or `CartesianChartTheme` | Theme mode or inline theme tokens for this chart. | | `preset` | `CartesianChartPresetValue` | Built-in or registered preset name used to seed chart colors and typography. | | `innerRadius` | `number` | Explicit inner radius in pixels. | | `innerRadiusRatio` | `number` | Inner radius as a fraction of the computed outer radius. | | `legend` | `boolean` or `PieChartLegendConfig` | Shows and configures the wrapped legend. | | `arcLabels` | `boolean` or `PieChartArcLabelsConfig` | Shows and configures external arc labels and connector lines. | | `sliceSeparator` | `boolean` or `PieChartSliceSeparatorConfig` | Draws separator strokes between slices. | | `selectedIndex` | `number` | Controlled selected slice index. | | `defaultSelectedIndex` | `number` | Initial uncontrolled selected slice index. | | `activeSlice` | `PieChartActiveSliceConfig` | Configures selected-slice stroke, opacity, offset, and scale. | | `selectionAnimation` | `boolean` or `PieChartSelectionAnimationConfig` | Enables and configures selected-slice animation. | | `interaction` | `PieChartInteraction` | Tap selection mode and callbacks. | | `centerLabel` | `string`, `ReactNode`, or `(props) => ReactNode` | Content rendered in the donut center. | | `renderer` | `PieChartRenderer` | Renderer implementation used for SVG-compatible primitives. | | `accessibilityLabel` | `string` | Overrides the generated accessible chart summary. | | `id` | `string` | Stable chart id used for coordinated selection scope. | | `testID` | `string` | Test identifier applied to the chart container. | | `formatValue` | `(value) => string` | Formats raw slice values in labels and accessible output. | | `formatPercentage` | `(percentage) => string` | Formats percentage labels in legends, arc labels, and accessible output. | [Edit page](https://github.com/chart-kit/react-native-chart-kit/edit/main/docs/charts/donut.md) [Previous Pie Chart](https://chartkit.io/docs/react-native/charts/pie/)[Next Progress Charts](https://chartkit.io/docs/react-native/charts/progress/) --- Source: https://chartkit.io/docs/react-native/charts/export # Export APIs Chart Kit Pro exports chart images for report screens, share sheets, generated PDFs, email attachments, support evidence, and background jobs. Use PNG when the chart should match the rendered app view. Use SVG when the output should stay small, editable, or server-generated. This workflow is available in Chart Kit Pro. Install it once from [Installation](https://chartkit.io/docs/react-native/charts/pro-installation/). ## Use cases | Use case | Recommended path | | --- | --- | | Share from a mobile screen | Capture the mounted chart as PNG, then share it. | | Save a report card | Capture the exact rendered view as PNG. | | Generate PDF content | Produce SVG or convert SVG to PNG in your PDF job. | | Background jobs | Use headless SVG generation from data and options. | | Support evidence | Export a deterministic chart image with the data snapshot. | ## Mounted PNG snapshot Use a capture adapter for the rendered React Native view. The example below uses `react-native-view-shot`, but the export controller accepts any adapter with the same shape. ```jsx import { useMemo, useRef } from "react"; import ViewShot, { captureRef } from "react-native-view-shot"; import { CombinedChart, createChartExportController } from "@chart-kit/pro"; const data = [ { month: "Jan", revenue: 118, margin: 18 }, { month: "Feb", revenue: 146, margin: 21 }, { month: "Mar", revenue: 182, margin: 23 }, { month: "Apr", revenue: 208, margin: 26 }, { month: "May", revenue: 236, margin: 28 }, { month: "Jun", revenue: 274, margin: 31 } ]; const money = (value) => `$${Math.round(value)}k`; const percent = (value) => `${Math.round(value)}%`; export function ExportableRevenueChart() { const chartRef = useRef(null); const exportController = useMemo( () => createChartExportController({ captureRef: (target, options) => captureRef(target, { format: "png", quality: options.quality ?? 1, result: options.result, width: options.width, height: options.height }) }), [] ); const savePng = async () => { const result = await exportController.snapshot({ fileName: "revenue-margin.png", format: "png", target: chartRef, width: 410, height: 300, result: "tmpfile" }); console.log(result.uri); }; return ( <>