Legend

The Legend component explains colors or series labels used by charts and data displays.

Usage & Examples

Chart Legend

Status
  • Open24
  • Resolved38
  • Escalated9
chart-legend.tsx
<Legend
  label="Status"
  items={[
    { label: "Open", color: "#2f80ed", value: "24" },
    { label: "Resolved", color: "#27ae60", value: "38" },
    { label: "Escalated", color: "#f2994a", value: "9" },
  ]}
/>

Props API

9 props
Columns
Legend props API
Default
Description
classNamestringNostylingAdditional class name for the root.
data-testidstringNotestingBackward-compatible alias for test ID attributes.
itemsLegendItem[]YespropsItems rendered in the legend.
labelReactNodeNopropsVisible legend label.
loadingbooleanNopropsfalseWhether the component should display a loading state.
orientation"horizontal" | "vertical"Noprops"horizontal"Legend orientation.
stateStateTypeNostylingVisual state class used for styling.
testIdstringNopropsdataTestId ?? "legend"Optional test ID for testing frameworks.
themeThemeTypeNostyling"primary"Theme class used for styling.