Skip to content

Prop Mapping

This table summarizes the current migration intent for common v1 props. It is a public-facing version of the internal compatibility matrix, scoped to props most apps actually use.

Line And Bar Props

v1 propv2 statusModern replacement
data.labelsSupported in compatdata rows plus xKey
data.datasets[].dataSupported in compatyKey, yKeys, or series
data.legendSupported in compatlegend plus series[].label
width / heightSupportedSame props
chartConfig.colorSupported in compattheme.colors.series or series[].color
chartConfig.labelColorSupported in compattheme.colors.mutedText
chartConfig.strokeWidthSupported in compatstrokeWidth or series[].strokeWidth
chartConfig.barPercentageSupported in compatbarWidthRatio
bezierSupported with changed internalscurve="monotone"
withDotsSupported in compatshowDots or series[].dot
withInnerLinesSupported in compatshowHorizontalGridLines / showVerticalGridLines
withOuterLinesCompatibility onlyModern charts avoid hard plot borders by default
formatXLabelSupportedSame prop
formatYLabelSupportedSame prop
fromZeroSupported in compatyDomain={{ min: 0, max: "dataMax" }}
yAxisLabelSupported in compatformatYLabel
yAxisSuffixSupported in compatformatYLabel
verticalLabelRotationSupported in compatlabelStrategy="rotate" plus labelRotation
horizontalLabelRotationSupported in compatPrefer auto layout or custom label rendering

Modern Series Mapping

Before:

import { LineChart } from "react-native-chart-kit";
const chartConfig = {
backgroundGradientFrom: "#ffffff",
backgroundGradientTo: "#ffffff",
color: () => "#2563eb"
};
<LineChart
data={{
labels: ["Jan", "Feb"],
datasets: [
{ data: [10, 14], color: () => "#2563eb", strokeWidth: 3 },
{ data: [8, 12], color: () => "#94a3b8", strokeWidth: 2 }
],
legend: ["Actual", "Target"]
}}
width={360}
height={220}
chartConfig={chartConfig}
/>;

After:

<LineChart
data={[
{ month: "Jan", actual: 10, target: 8 },
{ month: "Feb", actual: 14, target: 12 }
]}
xKey="month"
series={[
{ yKey: "actual", label: "Actual", color: "#2563eb", strokeWidth: 3 },
{ yKey: "target", label: "Target", color: "#94a3b8", strokeWidth: 2 }
]}
width={360}
height={240}
/>

Chart Config Mapping

Move reusable styling into ChartKitProvider or a custom preset.

import { ChartKitProvider, createChartPreset } from "react-native-chart-kit/v2";
const brand = createChartPreset({
light: {
background: "#ffffff",
plotBackground: "#ffffff",
grid: "#e5edf7",
text: "#0f172a",
mutedText: "#64748b",
series: ["#2563eb", "#0891b2", "#7c3aed"]
}
});
<ChartKitProvider preset="brand" presets={{ brand }}>
<Dashboard />
</ChartKitProvider>;

Props Not Promised

Do not depend on:

  • private AbstractChart internals
  • exact SVG child order
  • old clipping and padding bugs
  • deep imports from implementation files
  • chart-specific hacks that depend on old pixel positions

If a legacy chart needs one of those behaviors, keep it on the compatibility surface until there is an explicit modern extension point.