Renders a list of labels for data points in a chart. The LabelList component displays one label for each data point in a graphical element like Bar, Line, or Area.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/recharts/recharts/llms.txt
Use this file to discover all available pages before exploring further.
Usage
Props
Data
Decides how to extract the value of each label from the data.Can be a string, number, function, or array path.If set,
valueAccessor is ignored. Scatter charts require this prop.Function to get the value of each label.Ignored if
dataKey is specified.Signature: (entry: CartesianLabelListEntry | PolarLabelListEntry, index: number) => RenderableTextContent
Custom content for each label.Options:
ReactElement: Custom label element, cloned for each data pointfunction: Called once for each item to render custom label
Position
The position of labels relative to the view box.Cartesian positions:
top,bottom,left,rightinsideLeft,insideRight,insideTop,insideBottominsideTopLeft,insideTopRight,insideBottomLeft,insideBottomRightcenter,centerTop,centerBottom
insideStart,insideEnd,endoutside,center
The offset to the specified position.Direction of the offset depends on the position.
Formatting
Function to customize how content is serialized before rendering.Should return renderable text (string or number). Custom components are not supported here - use the
content prop instead.Signature: (label: RenderableText) => RenderableTextAppearance
Text rotation angle in degrees.Positive values rotate clockwise, negative values rotate counterclockwise.
If true, enables character-level breaking instead of word-level breaking.
The fill color of the label text.If not specified, inherits from the data entry.
The stroke color of the label text.
The font size of the label text.
The font family of the label text.
The font weight of the label text.
Polar charts
The parameter to calculate the view box of labels in radial charts.
Display
The z-index of the label list.Higher values render on top of lower values.
Other
Unique identifier of this component.Used as a prefix for each label’s HTML attribute
id.CSS class name for the label list container.
Context
The LabelList component consumes LabelListContext, which is typically provided by graphical elements like Bar, Line, Area, etc. When rendered as a child of a graphical element, the data and viewBox are automatically provided.Implicit usage
LabelList can be used implicitly via thelabel prop on graphical elements: