Skip to main content
Common TypeScript types used throughout Recharts.

Chart layout types

ChartOffset

Defines the blank space between the chart and the plot area. This space is occupied by supporting elements like axes, legends, and brushes.
Properties:
  • top - Distance from the top edge of the chart to the top edge of the plot area
  • bottom - Distance from the bottom edge of the chart to the bottom edge of the plot area (distance, not a coordinate)
  • left - Distance from the left edge of the chart to the left edge of the plot area
  • right - Distance from the right edge of the chart to the right edge of the plot area (distance, not a coordinate)
Example:

PlotArea

The area where the actual chart data is rendered (bars, lines, scatter points, etc.).
Properties:
  • width - The width of the plot area (same as chartWidth - offset.left - offset.right)
  • height - The height of the plot area (same as chartHeight - offset.top - offset.bottom)
  • x - The x coordinate of the top-left corner of the plot area (same as offset.left)
  • y - The y coordinate of the top-left corner of the plot area (same as offset.top)
Example:

Coordinate types

Coordinate

Represents a point in 2D space with x and y coordinates.
Example:

RectanglePosition

Margin

Layout types

CartesianLayout

Defines the orientation of Cartesian charts.
  • horizontal - X-axis is horizontal, Y-axis is vertical (default for most charts)
  • vertical - X-axis is vertical, Y-axis is horizontal
Example:

PolarLayout

Defines the orientation of polar charts.

Domain types

NumberDomain

Evaluated numerical domain with min and max values.
Example:

CategoricalDomain

Array of all possible categorical values.
Example:

Animation types

AnimationTiming

The type of easing function to use for animations.
Example:

AnimationDuration

Specifies the duration of animation in milliseconds.

Legend and symbol types

LegendType

Example:

SymbolType

Stack types

StackOffsetType

Determines how values are stacked.
Options:
  • none - Default, adds values on top of each other. Negative values will overlap.
  • expand - Values always add up to 1, chart looks like a rectangle
  • wiggle - Tries to keep the chart centered
  • silhouette - Tries to keep the chart centered
  • sign - Stacks positive values above zero and negative values below zero
  • positive - Ignores all negative values, then behaves like none
Example: