콘텐츠로 이동
RefineUI

Chart

데이터 시각화 차트 프리미티브.

Revenue

Last 6 months

JanFebMarAprMayJun

Overview

Machine-readable contract from Component Spec.

component: chartexport: Chartversion: 1attributes: data-refineui=chart

Anatomy

Partdata-refineui
rootchart
axis_labelschart-axis-labels
barchart-bar
bar_trackchart-bar-track
barschart-bars
bodychart-body
contentchart-content
gridchart-grid
hit_areachart-hit-area
legendchart-legend
legend_itemchart-legend-item
linechart-line
line_areachart-line-area
line_strokechart-line-stroke
plotchart-plot
plot_framechart-plot-frame
pointchart-point
tooltipchart-tooltip
y_axischart-y-axis

Layout

PropertyValue
directionlogical
rtltrue
npm install @refineui/react @refineui/tokens
import {
Chart,
ChartBody,
ChartContent,
ChartPlot,
ChartGrid,
ChartBars,
ChartLine,
ChartYAxisLabels,
ChartAxisLabels,
ChartLegend,
ChartLegendItem
} from "@refineui/react";
const data = [45, 52, 38, 65, 42, 80, 55];
const labels = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
<Chart>
<ChartBody>
<ChartContent>
<ChartYAxisLabels values={data} />
<ChartPlot aria-label="Weekly sales chart">
<ChartGrid values={data} />
<ChartBars values={data} seriesColor="blue" />
</ChartPlot>
<ChartAxisLabels labels={labels} />
</ChartContent>
</ChartBody>
<ChartLegend>
<ChartLegendItem seriesColor="blue">Sales</ChartLegendItem>
</ChartLegend>
</Chart>
<Chart>
<ChartBody>
<ChartContent>
<ChartPlot>
<ChartGrid values={data} lines={5} />
<ChartLine values={data} seriesColor="green" showArea showPoints />
</ChartPlot>
</ChartContent>
</ChartBody>
</Chart>

루트 차트 컨테이너.

메인 차트 본문 섹션.

차트 콘텐츠 래퍼.

SVG 플롯 영역.

PropDefaultTypeDescription
aria-labelstring차트의 접근 가능한 이름.
PropDefaultTypeDescription
lines5number가로 그리드 선 개수(기준선 포함).
maxnumberY 스케일 최댓값(생략 시 values에서 자동 산출).
valuesnumber[]스케일 산출용 소스 값.
PropDefaultTypeDescription
valuesnumber[]막대 값(필수).
maxnumberY 스케일 최댓값.
seriesColorChartSeriesColor시리즈 색상 키.
showTrackfalseboolean각 막대 뒤에 전체 높이 트랙을 표시합니다.
PropDefaultTypeDescription
valuesnumber[]선 값(필수).
maxnumberY 스케일 최댓값.
seriesColorChartSeriesColor시리즈 색상 키.
showAreafalseboolean선 아래 영역 채우기.
showPointsfalseboolean각 값의 포인트 마커.

Y축 눈금 레이블.

PropDefaultTypeDescription
valuesnumber[]스케일용 소스 값.
formatTick(value: number) => string커스텀 포매터.

X축 레이블.

PropDefaultTypeDescription
labelsstring[]레이블 문자열(필수).
align"bar""bar" | "line"정렬 스타일.

범례 리스트 컨테이너.

PropDefaultTypeDescription
seriesColorChartSeriesColor시리즈 색상 키(필수).