Skip to main content

Function: ChartLegendContent()

@arolariu/components


@arolariu/components / ChartLegendContent

Function: ChartLegendContent()

ChartLegendContent(__namedParameters): Element

Defined in: components/ui/chart.tsx:413

Renders shared legend content for charts configured with ChartContainer.

Parameters

__namedParameters

ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & object & DefaultLegendContentProps & Omit<PresentationAttributesAdaptChildEvent<any, ReactElement<unknown, string | JSXElementConstructor<any>>>, keyof DefaultLegendContentProps>

Returns

Element

Remarks

  • Renders a <div> element when legend payload exists
  • Built on recharts legend payloads and shared chart config context
  • Honors payload, verticalAlign, className, and the custom hideIcon and nameKey props
  • Ignores Recharts presentational props such as align, layout, iconSize, iconType, formatter, and item mouse handlers because it renders custom markup

Example

<ChartLegend content={<ChartLegendContent />} />

See

Recharts Legend Docs

// was this page useful?