Skip to content

v3.8.0

Choose a tag to compare

@PavelVanecek PavelVanecek released this 06 Mar 21:47
a1044db

What's Changed

We added generics to our data and dataKey props and now you can have your charts validated by TypeScript. See the full guide here: https://recharts.github.io/en-US/guide/typescript/

We are releasing new helper functions and hooks that will allow you to precisely target mouse interactions, and convert coordinates. See the guide here: https://recharts.github.io/en-US/guide/coordinateSystems/

And new functions and hooks:

getRelativeCoordinate - converts mouse events to pixel positions

Convert Data → Pixels:

useXAxisScale - returns a function to convert X data values to pixel positions
useYAxisScale - returns a function to convert Y data values to pixel positions
useCartesianScale - convenience hook for converting both at once

Pixels → Data:

useXAxisInverseScale - returns a function to convert pixel X to the closest data value
useYAxisInverseScale - returns a function to convert pixel Y to the closest data value
useXAxisInverseTickSnapScale - returns a function to convert pixel X to the closest axis tick
useYAxisInverseTickSnapScale - returns a function to convert pixel Y to the closest axis tick

Accessing Ticks:

useXAxisTicks - returns the calculated ticks of an X-axis
useYAxisTicks - returns the calculated ticks of a Y-axis

Feat

Fix

  • Pie: fix: enable tooltip synchronization for PieChart by @VIDHITTS in #6989
  • Pie: fix: sync pie tooltip/legend color with per-sector fill by @2YH02 in #6977
  • Bar: Fix activeBar highlighting with missing/null data by @Copilot in #7001
  • Bar: Support Bar CSS transitions by @PavelVanecek in #6920
  • XAxis/YAxis: respect user-provided textAnchor prop on XAxis/YAxis by @pierreeurope in #7028
  • Tooltip: Close tooltip on blur by @gVguy in #6958
  • General: fix error when onMouseEnter/Leave={undefined} by @SvetlanaVesna in #6969
  • Animation: [animations] auto disable primitives animations based on user system preferences by @cloud-walker in #6956
  • Animation/Line: fix: prevent animated line flicker with round/square strokeLinecap by @roy7 in #7022
  • Performance: filter zero-dimension rectangles early by @MendyLanda in #6800
  • Bump minimum @reduxjs/toolkit to 1.9.0 by @Copilot in #6934

Types

Docs

New Contributors

Full Changelog: v3.7.0...v3.8.0