useXAxisTicks

Returns the ticks of an XAxis.

This hook is useful for accessing the calculated ticks of an XAxis. The ticks are the same as the ones rendered by the XAxis 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

  • xAxisIdnumber | stringoptional

    The xAxisId of the XAxis. Defaults to 0 if not provided.

    DEFAULT: "defaultAxisId"