Chart

Playground

Properties

State

Usage

ChartLegend와 ChartTooltip으로 범례와 수치 정보를 구성합니다. 그래프를 그리는 기능은 포함하지 않으므로 앱에서 구현하거나 차트 라이브러리와 조합합니다. seriesColor, label, value를 실제 데이터에 연결합니다.

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

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

Playground의 Code 탭에서 현재 설정과 동작이 포함된 예제 전체를 복사할 수 있습니다. 공통 CSS 설치는 설치하기를 확인하세요.

Composition