Overview of @chart-kit/svg-renderer
main@chart-kit/svg-renderer package provides SVG renderer primitives for React Native Chart Kit. It serves as the default free renderer adapter built around react-native-svg.repository·main·Indexed 25 days ago
https://github.com/chart-kit/react-native-chart-kitA library for creating interactive charts in React Native applications, including Line, Area, Bar, Pie, Donut, Progress, and Contribution Heatmap visualizations. Version 7.0.2 features a modern v2 API with support for theming, interactivity, and accessibility summaries. The ecosystem includes @chart-kit/core for renderer-agnostic logic and @chart-kit/svg-renderer for react-native-svg integration. Advanced Pro Charts such as Candlebar, Radar, Realtime Bar, and Combo charts are available via a separate installation.
@chart-kit/svg-renderer package provides SVG renderer primitives for React Native Chart Kit. It serves as the default free renderer adapter built around react-native-svg.The react-native-chart-kit/v2 package is designed for modern Chart Kit usage in plain React Native CLI applications (non-Expo). When setting up a project using this version, ensure you have the following peer dependencies installed:
reactreact-nativereact-native-svgCommonly used components include LineChart, BarChart, and ProgressRing.
React Native Chart Kit provides several built-in chart types for mobile dashboards and reports:
Note: Advanced charts like Candlebar, Radar, Realtime Bar, and Combo charts are part of Chart Kit Pro and require a license.
Candlebar charts are designed for visualizing price movement and volume. Common use cases include:
Advanced visualization options are available through Pro Charts, which require a separate installation process:
The RadarChart component (available in Chart Kit Pro) compares multiple profiles across the same set of metrics. It is suitable for visualizing product quality, health scores, benchmarks, rubric scoring, and capability comparisons.
To use it, you must install the Pro package following the Installation guide.
Legacy charts are available through the standard root import from react-native-chart-kit. Note that these legacy components do not consume ChartKitProvider presets. To style them, you must pass props directly such as chartConfig, barColors, legendFontColor, and backgroundColor.
import {
BarChart,
ContributionGraph,
LineChart,
PieChart,
ProgressChart,
StackedBarChart
} from "react-native-chart-kit";You can enable slice selection using the interaction prop. For uncontrolled selection, set interaction={{ mode: "tap" }}. For controlled selection, pass selectedIndex and use the onSelect callback within the interaction object to update your state.
const revenueMix = [
{ plan: "Enterprise", revenue: 680 },
{ plan: "Business", revenue: 420 },
{ plan: "Teams", revenue: 260 },
{ plan: "Starter", revenue: 140 }
];
const [selectedIndex, setSelectedIndex] = useState(0);
<DonutChart
data={revenueMix}
valueKey="revenue"
labelKey="plan"
selectedIndex={selectedIndex}
interaction={{
mode: "tap",
onSelect: (event) => setSelectedIndex(event.index)
}}
centerLabel={revenueMix[selectedIndex]?.plan}
activeSlice={{ inactiveOpacity: 0.36, strokeWidth: 4 }}
width={410}
height={260}
/>;Choose a chart based on your data visualization goal:
Standard Charts:
LineChartAreaChartBarChartDonutChart (preferred) or PieChartProgressChart or ProgressRingContributionGraph or CalendarHeatmapPro Charts (Commercial):
CombinedChartCandlestickChart or CandlebarChartRealtimeBarChartRadarChartTo use the v2 features, install both react-native-chart-kit and react-native-svg. When importing components, ensure you use the /v2 entry point to access the updated API.
npm install react-native-chart-kit react-native-svgimport {
BarChart,
ChartKitProvider,
DonutChart,
LineChart
} from "react-native-chart-kit/v2";The Realtime.BarChart component is designed for live analytics and monitoring dashboards. It renders a rolling bar window where visual slots remain stable while new data points slide into view. This ensures that selection and tooltip states follow the specific data point (via liveKey) rather than a moving array index.
Note: This component is part of Chart Kit Pro. You must install it via the Pro Installation guide.
import { Realtime } from "@chart-kit/pro";
<Realtime.BarChart
data={rows}
xKey="pointIndex"
yKey="users"
liveKey="pointIndex"
windowSize={30}
animation={{ duration: 2000, mode: "slide" }}
// ... other props
/>