Chart

Playground

Properties

State

Usage

Use ChartLegend and ChartTooltip to show legends and values. Draw the graph in your app or use a chart library; these components do not render it. Set seriesColor, label and value from your data.

'use client';
import { ChartLegendSection, ChartLegend } from '@mbsw/ui';

export default function Example() {
  return (
    <ChartLegendSection aria-label={"Chart legend"}>
      <ChartLegend label="A" value="1,240" seriesColor="#5283dc" />
      <ChartLegend label="B" value="320" seriesColor="#8b6fc0" />
    </ChartLegendSection>
  );
}

The Playground Code tab includes the full example with your current settings. See Installation for the CSS imports.

Composition