Reflex Cloud - Fast, secure & scalable hosting. One command to deploy.

Legend

A legend tells what each plot represents. Just like on a map, the legend helps the reader understand what they are looking at. For a line graph for example it tells us what each line represents.

Simple Example

Example with Props

The style and layout of the legend can be customized using a set of props. width and height set the dimensions of the container that wraps the legend, and layout can set the legend to display vertically or horizontally. align and vertical_align set the position relative to the chart container. The type and size of icons can be set using icon_size and icon_type.

API Reference

rx.recharts.Legend

A Legend component in Recharts.

PropType | ValuesDefault
width
int
height
int
layout
"vertical" | "horizontal"
"horizontal"
align
"left" | "center" | ...
"center"
vertical_align
"top" | "middle" | ...
"bottom"
icon_size
int
14
icon_type
"line" | "plainline" | ...
payload
List
[]
chart_width
int
chart_height
int
margin
Dict[str, Any]

Event Triggers

See the full list of default event triggers