v3.7.0
v3.7.0
⚠️ Breaking Changes
Celldeprecated — migrate to theshapeprop on chart elements; will be removed in next major version
Features
- New hooks:
useIsTooltipActive(),useActiveTooltipCoordinate() Tooltip:offsetprop now acceptsCoordinateobjectX/YAxis: new"auto"axis type — auto-detects "category" or "number"Bar: addedBarShapePropsTypeScript type forshapeprop- TypeScript: exported missing types for
contentandshapefunctions
Fixes
BarChart: fixedstackOffset=signcalculation with 3+ positive values per seriesBarStack: resolved circular dependency in Vite buildsBarStack: fixedclipPathrendering withstackOffset=signBarStack: bar radius now applies to active bars
Improvements
- TypeScript: enabled
strictmode across codebase - Docs auto-generated from code for improved accuracy
- Website dark mode added
- Recharts devtools integrated into all website examples
What's Changed
📢 Cell is now deprecated and will be removed in the next major version. Please migrate all Cell usage to use the shape prop of respective chart elements. ‼️
Feat
New Hooks
useIsTooltipActive: returns if the tooltip is active by @PavelVanecek in https://github.com/recharts/recharts/pull/6880useActiveTooltipCoordinate: returns current tooltip coordinate by @PavelVanecek in https://github.com/recharts/recharts/pull/6880
Other
Tooltip: allowoffsetprop to accept Coordinate object by @bigsaigon333 in https://github.com/recharts/recharts/pull/6868X/YAxisadd new axis type: "auto" by @PavelVanecek in https://github.com/recharts/recharts/pull/6823- sets the type to "category" for categorical axes, and "number" for numeric axis.
X/YAxis: replacetick: anywith explicit type by @PavelVanecek in https://github.com/recharts/recharts/pull/6911Bar/TypeScript: addBarShapePropstype to fixBar.shapetype by @PavelVanecek in https://github.com/recharts/recharts/pull/6900TypeScript: add missing useful type exports forcontent,shapefunctions, etc. @PavelVanecek in https://github.com/recharts/recharts/pull/6852
Fix
BarChart: fixstackOffset=signfor charts with 3 or more positive values in one series by @PavelVanecek in https://github.com/recharts/recharts/pull/6807BarStack: fix circular dependency when building with vite by @jkr2255 in https://github.com/recharts/recharts/pull/6777BarStack: fixBarStackclipPathin charts withstackOffset=signby @PavelVanecek in https://github.com/recharts/recharts/pull/6806BarStack: apply bar stack radius to active bars by @PavelVanecek in https://github.com/recharts/recharts/pull/6906
Chore
- Enabled
stricttsconfig by @PavelVanecek in https://github.com/recharts/recharts/pull/6842
Docs
We've started auto-generating our docs for the most part so you should see large improvements in accuracy of the docs between the code, the website, and the storybook. Huge shoutout to @PavelVanecek 🚀
- Dark mode 🕶️ by @cloud-walker in https://github.com/recharts/recharts/pull/6828
- Thanks @cloud-walker
- Recharts devtools has been added to all website examples for easier issue debugging
New Contributors
- @jkr2255 made their first contribution in https://github.com/recharts/recharts/pull/6777
- @cloud-walker made their first contribution in https://github.com/recharts/recharts/pull/6824
- @bigsaigon333 made their first contribution in https://github.com/recharts/recharts/pull/6868
- @huangkevin-apr made their first contribution in https://github.com/recharts/recharts/pull/6872
Full Changelog: https://github.com/recharts/recharts/compare/v3.6.0...v3.7.0