unstale

npm / recharts

recharts

What changed in recharts 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-29.

9 breaking1 security4 deprecations61 new APIs and options5 performance16 behavior and defaults4 tooling95 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

recharts 3195 changes

Breaking changes 9

  • Labels for elements outside the clipped domain are skipped, and Bar labels retain their data index after skipped bars.

    3.11.0release notes

  • Pie no longer allocates minAngle or padding to null values.

    3.11.0release notes

  • ReferenceArea skips rendering when an edge is not on the axis.

    3.11.0release notes

  • Tooltip no longer falls back to activeIndex for an unmatched axis label.

    3.11.0release notes

  • The previous align prop is replaced by position and offset.

    3.10.0release notes

  • The previous verticalAlign prop is replaced by position and offset.

    3.10.0release notes

  • The CartesianGrid background now renders below the grid lines instead of above them.

    3.0.0release notes

  • CategoricalChartState no longer exists in event handlers or Customized, removing access to Recharts internal state.

    3.0.0release notes

  • Customized no longer receives Recharts state or props.

    3.0.0release notes

Security 1

  • Guards prevent infinite loops and ReDoS from pathological calc() input.

    3.11.0release notes

Deprecations 4

  • Cell is deprecated and will be removed in the next major version; migrate its usage to the shape prop of the respective chart elements.

    3.7.0release notes

  • Deprecates CartesianAxis.

    3.6.0release notes

  • Pie activeShape is deprecated; use shape and the isActive prop passed from its callback to create active Pie sectors.

    3.5.0release notes

  • Pie inactiveShape is deprecated in favor of the shape prop.

    3.5.0release notes

New APIs and options 61

  • Text, Label, and LabelList accept a background prop.

    3.11.0release notes

  • Bar accepts a data prop directly, like Line, Area, and Scatter.

    3.11.0release notes

  • Bar fill can be an object containing a gradient, pattern, or custom definition.

    3.11.0release notes

  • Text, Label, and LabelList support halo as a lighter alternative to background.

    3.11.0release notes

  • LabelList is supported for Sunburst labels, which can also be themed.

    3.11.0release notes

  • Patterns are available for chart styling, supporting improved accessibility.

    3.11.0release notes

  • Prop interfaces referenced by public component props are exported.

    3.11.0release notes

  • RadialBar supports a minimum bar angle through minAngle.

    3.11.0release notes

  • Sankey node labels can be rendered through LabelList.

    3.11.0release notes

  • Line, Area, Radar, and Scatter support symbol dots and matching legend icons.

    3.11.0release notes

  • Text supports textPath, and polar labels can be angled.

    3.11.0release notes

  • Themes can be stored in a context and inherited by charts throughout the React tree, allowing a shared look.

    3.11.0release notes

  • Legend now supports offset for more convenient positioning.

    3.10.0release notes

  • Legend now supports position for more convenient positioning, replacing the previous align and verticalAlign props.

    3.10.0release notes

  • Sankey now supports the accessibilityLayer prop.

    3.10.0release notes

  • Sankey now supports the desc prop.

    3.10.0release notes

  • Sankey now supports the title prop.

    3.10.0release notes

  • XAxis supports height="auto" to size the axis to its tick labels.

    3.10.0release notes

  • Animations are now fully customizable, with new animation props and fixes to existing animation behavior.

    3.9.0release notes

  • The interpolate function is exported and documented for use with animations.

    3.9.0release notes

  • ResponsiveContainer now allows HTML attributes to be passed through.

    3.9.0release notes

  • Treemap adds nodeInset and nodeGap properties for layout control.

    3.9.0release notes

  • The hook is annotated as available since 3.9.

    3.9.0release notes

  • Chart layout hooks and layout types are exposed in the public API.

    3.9.0release notes

  • Adds the cursor prop type to BaseChartProps.

    3.8.1release notes

  • Area gains external generics.

    3.8.0release notes

  • Bar gains generic types.

    3.8.0release notes

  • The data prop supports generics, allowing chart data to be validated by TypeScript.

    3.8.0release notes

  • Chart props gain event throttling controls.

    3.8.0release notes

  • Graphical items and charts gain optional explicit generics.

    3.8.0release notes

  • Legend adds a label style prop.

    3.8.0release notes

  • A typed charts helper is added.

    3.8.0release notes

  • The new niceTIcks prop accepts 'none', 'auto', 'equidistant', or 'nice' to select tick behavior.

    3.8.0release notes

  • A new hook returns the current tooltip coordinate.

    3.7.0release notes

  • A new hook returns whether the tooltip is active.

    3.7.0release notes

  • The axis type can now be auto, which selects category for categorical axes and number for numeric axes.

    3.7.0release notes

  • Exports AxisInterval from the public API.

    3.6.0release notes

  • Enables ranged stacked bars.

    3.6.0release notes

  • Exports BarRectangleItem from the public API.

    3.6.0release notes

  • Adds a component for configuring settings, such as radius, for a whole stack of bars.

    3.6.0release notes

  • Exports DataKey from the public API.

    3.6.0release notes

  • Exports the type for the Pie shape function.

    3.6.0release notes

  • Adds graphicalItemId to the tooltip payload object.

    3.6.0release notes

  • Exports TooltipIndex from the public API.

    3.6.0release notes

  • Exports TreemapNode from the public API.

    3.6.0release notes

  • Adds the equidistantPreserveEnd interval option for XAxis and YAxis.

    3.6.0release notes

  • The ActiveDotProps type is now exported for use in TypeScript code.

    3.5.0release notes

  • The DotItemDotProps type is now exported for use in TypeScript code.

    3.5.0release notes

  • Stacked charts now support reverseStackOrder, fixing a regression between Recharts 2 and 3.

    3.5.0release notes

  • Pie now accepts shape to customize sector shapes in line with other chart elements; use the isActive prop passed to the callback to create active sectors.

    3.5.0release notes

  • Exported DefaultZIndexes so it can be imported by developers.

    3.4.1release notes

  • Exported ZIndexLayer so it can be imported by developers.

    3.4.1release notes

  • Line adds a shape property for custom shape implementations.

    3.4.0release notes

  • Sankey supports left-aligned nodes through the align prop.

    3.4.0release notes

  • Sankey supports top-aligned nodes through the verticalAlign prop.

    3.4.0release notes

  • Many chart components now support z-index ordering, allowing Recharts elements to be positioned like CSS elements.

    3.4.0release notes

  • Add the responsive prop to any chart with a height and width, avoiding the need to wrap it in ResponsiveContainer.

    3.3.0release notes

  • You can render any React component in the Recharts tree structure, provided it is renderable within an SVG.

    3.0.0release notes

  • Portals let you position tooltip data anywhere, including outside the chart.

    3.0.0release notes

  • The symlog d3 scale type is supported for XAxis.

    3.0.0release notes

  • The symlog d3 scale type is supported for YAxis.

    3.0.0release notes

Performance 5

  • Avoids exponential depth traversal on dense graphs, improving Sankey graph processing.

    3.9.2release notes

  • ScatterChart hover reduces re-renders from O(n) to O(1).

    3.9.1release notes

  • Tree-shaking improvements and removal of unnecessary loops reduce the final bundle size.

    3.9.0release notes

  • Pie charts skip minAngle redistribution when no segment needs it.

    3.8.1release notes

  • This release includes performance improvements, including optimizing SetTooltipEntrySettings to break an infinite rendering loop.

    3.5.0release notes

Behavior and default changes 16

  • polarRadius accepts percentages.

    3.11.0release notes

  • Recharts themes are a public API from version 3.11; their overall shape will not change incompatibly in minor or patch releases, but specific styles and the number of graphicalItems are not covered.

    3.11.0docs

  • Treemap tile labels can be rendered through the shared LabelList.

    3.11.0release notes

  • PieChart adds dataKey to the Legend payload.

    3.9.0release notes

  • Updates tick calculation and domain extension.

    3.8.1release notes

  • Bar supports CSS transitions.

    3.8.0release notes

  • Primitive animations are automatically disabled based on user system preferences.

    3.8.0release notes

  • Tooltip closes on blur.

    3.8.0release notes

  • Bar stack radius is now applied to active bars.

    3.7.0release notes

  • The offset prop now accepts a Coordinate object.

    3.7.0release notes

  • The Tooltip activeLabel type is now string | number; this may break code that relied on it being a string.

    3.5.1release notes

  • The immutable check is disabled in production, removing console warnings.

    3.5.0release notes

  • Stacked bar animations are improved.

    3.4.0release notes

  • ResponsiveContainer now shrinks only in the dimensions where shrinking is needed.

    3.3.0release notes

  • accessibilityLayer is on by default for all polar and cartesian charts, enabling keyboard navigation with Tab and the arrow keys.

    3.0.0release notes

  • Pie sectors no longer show a border when clicked.

    3.0.0release notes

Tooling 4

  • @types/react is declared as an optional peer dependency.

    3.11.0release notes

  • The dataKey prop supports generics, allowing chart data to be validated by TypeScript.

    3.8.0release notes

  • Type definitions for LabelList and Area are enhanced.

    3.8.0release notes

  • Area.label now has a specific type instead of any.

    3.5.0release notes

Fixes and other changes 95

  • Arrow and Enter key defaults are consumed so Safari stops scrolling the page.

    3.11.0release notes

  • A two-tick axis whose domain crosses zero no longer overflows the stack.

    3.11.0release notes

  • Bar no longer spuriously re-animates on unrelated re-renders.

    3.11.0release notes

  • A single bar renders on a numeric axis without barSize.

    3.11.0release notes

  • Text wrapping with breakAll preserves Unicode code points.

    3.11.0release notes

  • Brush honors a selection containing only the first data point and keeps its start and end indices inside the data.

    3.11.0release notes

  • Defaults are honored when a dataKey function returns undefined.

    3.11.0release notes

  • On XAxis, this mode renders one tick when the end label overflows.

    3.11.0release notes

  • Error bars extend the axis domain for stacked items and are clipped with their graphical item.

    3.11.0release notes

  • Object.prototype keys are no longer reported as duplicates.

    3.11.0release notes

  • XAxis recovers height="auto" after starting with empty data.

    3.11.0release notes

  • Vertical lines break at null values, matching horizontal lines.

    3.11.0release notes

  • LRUCache stays within maxSize and refreshes recency for undefined values.

    3.11.0release notes

  • Stacked minPointSize no longer inflates bars over neighboring segments.

    3.11.0release notes

  • maxRadius now constrains percentage-based radii.

    3.11.0release notes

  • A rectangle remains mounted while it animates to zero.

    3.11.0release notes

  • The domain of an axis with no stacked items is preserved.

    3.11.0release notes

  • Documentation now explains the function form of syncMethod for charts with different data.

    3.11.0release notes

  • z-index portal groups no longer receive tabIndex, preventing pointer focus rings.

    3.11.0release notes

  • Text wrapping and truncation preserve grapheme boundaries and retain the final fitting truncation prefix.

    3.11.0release notes

  • Text no longer crashes with maxLines when content is empty.

    3.11.0release notes

  • Pending throttled mousemove is cancelled on mouseleave, and touch tooltips keep working after a throttled touch misses an item.

    3.11.0release notes

  • Cartesian YAxis updates its width to the initial size when data changes.

    3.11.0release notes

  • Documentation describes the zIndex prop on Pie, Radar, and RadialBar.

    3.11.0release notes

  • Tooltip search falls back to index-based search when label-based search returns undefined with allowDuplicatedCategory=false.

    3.10.1release notes

  • Pie passes computed innerRadius and outerRadius to Label children via PolarLabelContextProvider.

    3.10.1release notes

  • Keeps barGap correct when maxBarSize clamps the bar width.

    3.10.1release notes

  • Stale active bar layer state is cleared.

    3.10.0release notes

  • connectNulls no longer connects across stacked points where every series is null.

    3.10.0release notes

  • Floating-point tick gaps no longer cause getBandSizeOfAxis to collapse band size.

    3.10.0release notes

  • Controlled startIndex and endIndex no longer cause the brush to snap back on mouseup or be lost on data updates.

    3.10.0release notes

  • Custom label content now receives computed position attributes.

    3.10.0release notes

  • The Legend type is fixed.

    3.10.0release notes

  • Tooltip now finds the active sector in the angle-axis wrap-around gap.

    3.10.0release notes

  • The legend icon aria-label omits empty values.

    3.9.1release notes

  • Fixes the formatter prop for individual graphical items.

    3.9.1release notes

  • Removes a trailing duplicate tick when allowDecimals is false.

    3.9.1release notes

  • Sankey nodes no longer overlap links that skip depths.

    3.9.1release notes

  • Explicit ticks render when a non-literal domain cannot resolve on empty data.

    3.9.1release notes

  • Tooltip dispatch in Bar now uses originalDataIndex.

    3.9.0release notes

  • Stacked bars now render when all values are zero.

    3.9.0release notes

  • Prevents a NaN coordinate layout crash when all values are zero.

    3.9.0release notes

  • Legend no longer overlaps the chart when the container is resized.

    3.9.0release notes

  • Fixes an erroneous console warning during initialization.

    3.9.0release notes

  • Prevents NaN node positions when link values sum to zero.

    3.9.0release notes

  • Tooltips now preserve valid falsy custom names such as 0 and the empty string.

    3.9.0release notes

  • Axis padding is no longer ignored by the clipping mask when allowDataOverflow is enabled with a restricted domain.

    3.9.0release notes

  • Uses entry.value for the aria-label when a formatter returns a React element.

    3.8.1release notes

  • Restores arrow key navigation when the active index is outside the zoomed range.

    3.8.1release notes

  • Resolves keyboard navigation and tooltip issues for Pie charts.

    3.8.1release notes

  • Fixes a double padding gap when a data item has value 0.

    3.8.1release notes

  • Updates the ticks prop type for PolarRadiusAxis.

    3.8.1release notes

  • Prevents tooltip flicker with syncMethod="value" when data arrays have mismatched lengths.

    3.8.1release notes

  • Prevents crashes when payload entries are sparse or undefined.

    3.8.1release notes

  • Prevents stackOffset="expand" from overriding the numerical XAxis domain.

    3.8.1release notes

  • Elements no longer disappear during dynamic zIndex transitions.

    3.8.1release notes

  • Active bar highlighting works with missing or null data.

    3.8.0release notes

  • Prevents animated line flicker with round or square strokeLinecap.

    3.8.0release notes

  • Mouse event typing is fixed.

    3.8.0release notes

  • Charts no longer error when onMouseEnter or onMouseLeave is undefined.

    3.8.0release notes

  • Tooltip and legend colors now synchronize with per-sector fill.

    3.8.0release notes

  • Event types for Pie and RadialBar are fixed.

    3.8.0release notes

  • Pie event handler types are fixed.

    3.8.0release notes

  • Tooltip synchronization is enabled for PieChart.

    3.8.0release notes

  • PolarAngleAxis event types are fixed.

    3.8.0release notes

  • XAxis and YAxis now respect a user-provided textAnchor prop.

    3.8.0release notes

  • Tooltip payload typing is corrected from any.

    3.8.0release notes

  • Event types for XAxis and YAxis are updated.

    3.8.0release notes

  • Fixes stackOffset=sign for charts with three or more positive values in one series.

    3.7.0release notes

  • A new type fixes the TypeScript type for Bar.shape.

    3.7.0release notes

  • Fixes a circular dependency that occurred when building with Vite.

    3.7.0release notes

  • Fixes BarStack clipPath in charts using stackOffset=sign.

    3.7.0release notes

  • The tick type is now explicit instead of any.

    3.7.0release notes

  • Rounds numbers before putting them to the DOM.

    3.6.0release notes

  • Fixes a crash when a Label is passed as content to LabelList.

    3.6.0release notes

  • Fixes duplicated or unrelated tooltip payload data when multiple Scatter elements are used in one ScatterChart.

    3.6.0release notes

  • Stores refs instead of IDs to unblock shadow DOM use cases.

    3.6.0release notes

  • The accidental eslint dependency was removed from main dependencies, so it should no longer be installed with recharts.

    3.5.1release notes

  • The Pie shape prop includes the Sector index, enabling customization of specific slices similar to activeIndex in 2.x.

    3.5.1release notes

  • In multi-Pie PieCharts with shared dataKeys, only the hovered Sector is marked active, preventing cross-Pie highlighting.

    3.5.1release notes

  • Recharts ZIndex SVG portal g tags receive tabIndex -1 to prevent extraneous focusable surfaces.

    3.5.1release notes

  • ErrorBar no longer emits a duplicate key warning when an error range has identical values.

    3.5.0release notes

  • A Legend with a portal no longer adjusts the chart margin and leaves empty space.

    3.5.0release notes

  • Line animation now works correctly when interrupted by changes unrelated to data.

    3.5.0release notes

  • Active dots no longer appear outside the graph.

    3.5.0release notes

  • Overlapping 0 and 360 ticks are prevented.

    3.5.0release notes

  • Fixes a regression that prevented Area event handlers from firing correctly.

    3.4.0release notes

  • Fixes stacked bar charts with a brush removing elements from the wrong side of the chart.

    3.4.0release notes

  • Fixes Funnel label positioning issues from the previous release.

    3.4.0release notes

  • Fixes Funnel margin calculations.

    3.4.0release notes

  • Label now allows overwriting the textAnchor prop.

    3.4.0release notes

  • Label and Text types are corrected to include only what they can actually render.

    3.4.0release notes

  • Fixes a unique key error in Sankey.

    3.3.0release notes

  • Fixes animation stutters in Treemap.

    3.3.0release notes

  • The width="auto" oscillation detection now applies only when the difference is greater than 1 pixel.

    3.3.0release notes