useYAxisTicks

Returns the ticks of a YAxis.

This hook is useful for accessing the calculated ticks of a YAxis. The ticks are the same as the ones rendered by the YAxis component.

Available since Recharts 3.8

Return value

Array<CartesianTickItem> | undefined

An array of ticks, or undefined if the axis doesn't exist or hasn't been calculated yet.

Props

  • yAxisIdnumber | stringoptional

    The yAxisId of the YAxis. Defaults to 0 if not provided.

    DEFAULT: "defaultAxisId"