Chart

Exports

@mbsw/ui에서 가져올 수 있는 항목입니다.

ChartLegend
ChartLegendSection
ChartLegendSwatch
ChartTooltip
ChartTooltipItem

Props

컴포넌트별 주요 속성입니다. 조건부 속성의 조합과 공통 HTML, Radix 속성은 아래 전체 타입에서 확인하세요.

ChartLegend

ChartLegend 속성
PropType필수 여부
valuestring | (readonly string[] & string)선택
seriesColorstring선택
labelstring필수
size'md' | 'sm'선택
state'default' | 'selected' | 'inactive'선택
swatchShape'line' | 'square'선택
swatchVariant'default' | 'dash'선택

ChartLegendSection

ChartLegendSection 속성
PropType필수 여부
childrenChartLegendChild필수
direction'vertical' | 'horizontal'선택
size'md' | 'sm'선택

ChartLegendSwatch

ChartLegendSwatch 속성
PropType필수 여부
seriesColorstring선택
shape'line' | 'square'선택
size'md' | 'sm'선택
variant'default' | 'dash'선택

ChartTooltip

ChartTooltip 속성
PropType필수 여부
childrenChartTooltipItemElement | readonly ChartTooltipItemElement[]필수
datestring필수

ChartTooltipItem

ChartTooltipItem 속성
PropType필수 여부
seriesColorstring선택
labelstring필수
valuestring필수

Type reference

전체 타입 보기

속성 조합과 상속 속성을 포함한 TypeScript 선언입니다.

import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactElement } from 'react';

type DataAttributes = {
    [key: `data-${string}`]: boolean | number | string | undefined;
};

type SpanProps = HTMLAttributes<HTMLSpanElement> & DataAttributes;

type DivProps = HTMLAttributes<HTMLDivElement> & DataAttributes;

type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & DataAttributes;

export type ChartLegendSwatchShape = 'line' | 'square';

export type ChartLegendSwatchVariant = 'default' | 'dash';

export type ChartLegendSize = 'md' | 'sm';

export type ChartLegendState = 'default' | 'selected' | 'inactive';

export type ChartLegendSectionDirection = 'vertical' | 'horizontal';

type SeriesColorProps = {
    seriesColor?: string;
};

export type ChartLegendSwatchProps = Omit<SpanProps, 'aria-hidden' | 'children' | 'color' | 'contentEditable' | 'tabIndex'> & SeriesColorProps & {
    shape?: ChartLegendSwatchShape;
    size?: ChartLegendSize;
    variant?: ChartLegendSwatchVariant;
};

export type ChartLegendProps = Omit<ButtonProps, 'aria-selected' | 'children' | 'color' | 'disabled' | 'role' | 'type'> & SeriesColorProps & {
    label: string;
    size?: ChartLegendSize;
    state?: ChartLegendState;
    swatchShape?: ChartLegendSwatchShape;
    swatchVariant?: ChartLegendSwatchVariant;
    value?: string;
};

type ChartLegendElement = ReactElement<ChartLegendProps>;

type ChartLegendChild = ChartLegendElement | readonly ChartLegendChild[];

export type ChartLegendSectionProps = Omit<DivProps, 'children' | 'role'> & {
    children: ChartLegendChild;
    direction?: ChartLegendSectionDirection;
    size?: ChartLegendSize;
};

export type ChartTooltipItemProps = Omit<DivProps, 'children' | 'color'> & SeriesColorProps & {
    label: string;
    value: string;
};

type ChartTooltipItemElement = ReactElement<ChartTooltipItemProps>;

export type ChartTooltipProps = Omit<DivProps, 'children'> & {
    children: ChartTooltipItemElement | readonly ChartTooltipItemElement[];
    date: string;
};

export declare const ChartLegendSwatch: import("react").ForwardRefExoticComponent<Omit<SpanProps, "tabIndex" | "contentEditable" | "color" | "aria-hidden" | "children"> & SeriesColorProps & {
    shape?: ChartLegendSwatchShape;
    size?: ChartLegendSize;
    variant?: ChartLegendSwatchVariant;
} & import("react").RefAttributes<HTMLSpanElement>>;

export declare const ChartLegend: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "role" | "color" | "aria-selected" | "children" | "disabled" | "type"> & SeriesColorProps & {
    label: string;
    size?: ChartLegendSize;
    state?: ChartLegendState;
    swatchShape?: ChartLegendSwatchShape;
    swatchVariant?: ChartLegendSwatchVariant;
    value?: string;
} & import("react").RefAttributes<HTMLButtonElement>>;

export declare const ChartLegendSection: import("react").ForwardRefExoticComponent<Omit<DivProps, "role" | "children"> & {
    children: ChartLegendChild;
    direction?: ChartLegendSectionDirection;
    size?: ChartLegendSize;
} & import("react").RefAttributes<HTMLDivElement>>;

export declare const ChartTooltipItem: import("react").ForwardRefExoticComponent<Omit<DivProps, "color" | "children"> & SeriesColorProps & {
    label: string;
    value: string;
} & import("react").RefAttributes<HTMLDivElement>>;

export declare const ChartTooltip: import("react").ForwardRefExoticComponent<Omit<DivProps, "children"> & {
    children: ChartTooltipItemElement | readonly ChartTooltipItemElement[];
    date: string;
} & import("react").RefAttributes<HTMLDivElement>>;