reopt design
DocsExploreTemplatesCanvasToolsPricing
Login
opt-uiopt-chartsopt-datagridopt-editoropt-calendaropt-filemanageropt-chatopt-shellbrandapp-ui
opt-charts40
BarChart
reopt designreopt design

A design system for the AI era

  • Docs
  • Pricing
  • Releases
  • About
  • Contact
  • Terms of Service
  • Privacy Policy

reopt Inc.Business registration no. 217-88-02453contact@reopt.ai

© 2026 reopt Inc. All rights reserved.

BarChart

Chart

Compare values across categories with a bar chart.

cartesian
Related docs
bun add @reopt-ai/opt-charts
Install and import
bash
bun add @reopt-ai/opt-charts
tsx
import { BarChart } from "@reopt-ai/opt-charts";

Live preview

Change the width and theme, then interact with the components.

100%

Basic Bar Chart

Stacked & Grouped

Stacked

Grouped

Vertical Layout

Annotations (references and data labels)

Target lines, bands, and value labels

Usage examples

Bar chart

BarChart

PropTypeDefaultDescription
dataRequiredChartDataPoint[]—차트 데이터 배열
seriesRequiredChartSeriesDef[]—시리즈 정의 (dataKey, name, color)
xAxisKeystring"name"X축 데이터 키
heightnumber | `${number}%`300차트 높이
classNamestring—루트 요소에 붙는 CSS 클래스
showGridbooleantrue그리드 표시 여부
showTooltipbooleantrue툴팁 표시 여부
showLegendboolean—범례 표시 여부. 미지정 시 시리즈가 2개 이상일 때만 표시
showXAxisbooleantrueX축 표시 여부
showYAxisbooleantrueY축 표시 여부
animatebooleantrue애니메이션. false면 끄고, 그 외에는 prefers-reduced-motion을 따릅니다
marginChartMargin{ top: 8, right: 16, bottom: 4, left: 0 }차트 여백 (top/right/bottom/left)
layout"horizontal" | "vertical""horizontal"차트 방향
stackedbooleanfalse스택형 막대 차트
referenceLinesChartReferenceLine[]—기준선 정의 배열
referenceAreasChartReferenceArea[]—기준 영역 정의 배열
showValuesbooleanfalse막대 위에 값 레이블을 그릴지 여부
valueFormatter(value: number) => string—값 축 눈금 포맷터. 기본은 로케일 인식 축약 숫자
categoryFormatter(value: string | number) => string—범주 축 눈금 포맷터
localestring—기본 숫자 포맷의 로케일. 미지정 시 런타임 로케일
loadingbooleanfalse재조회 중 현재 렌더를 흐리게 유지합니다(스켈레톤 플래시 없음)
accessibleTablebooleanfalse스크린 리더용으로 시각적으로 숨긴 데이터 표를 함께 렌더합니다
emptyStateReact.ReactNode—데이터가 없을 때 보여줄 내용. 기본은 labels.empty 문구
labelsBarChartLabels—빈 상태·표 캡션·범주 열·차트 이름의 현지화 문자열
tooltipOptionsChartTooltipContentProps—ChartTooltipContent에 그대로 넘길 옵션
legendOptionsChartLegendOptions—ChartLegendContent에 그대로 넘길 옵션. inactiveKeys에 담긴 dataKey는 범례에서 흐려지고 차트에서도 그려지지 않습니다
legendTogglebooleantrue범례 칩 클릭으로 시리즈를 켜고 끕니다. legendOptions.inactiveKeys를 주면 호출자가 상태를 소유하고, onClick만 주면 클릭을 전달받으면서 차트가 상태를 유지합니다. 마지막 남은 시리즈는 꺼지지 않습니다. false면 정적 범례
syncIdstring—같은 syncId를 가진 차트끼리 툴팁과 커서를 함께 움직입니다. 범주형 차트는 행 인덱스로 맞추므로 X축 순서가 같아야 합니다
onPointClickChartPointClickHandler—(point: { index, category, payload }) => void. 점을 클릭하거나, 포커스된 플롯에서 화살표로 이동한 뒤 Enter를 누르면 호출됩니다. 지정 시 플롯에 pointer 커서가 생기고 Enter는 툴팁을 숨기지 않습니다
aria-labelstring—스크린 리더용 레이블
aria-describedbystring—차트를 설명하는 요소의 id
barSizenumber—막대 너비
radiusnumber | [number, number, number, number]4막대 모서리 반경

컴포넌트 의존 관계

깊이
▲ USED BY (7)query-result-chartbilling-pageanalytics-dashboardacquisition-analysisbreakdown-analysispath-analysisproject-overviewBarChart
View test results

테스트 커버리지

2026년 7월 9일

생성된 테스트 결과를 찾지 못했습니다.

BarChart 항목이 문서 메타에 연결되어 있지만 현재 생성 파일에는 없습니다.

테스트를 추가한 뒤 `bun run generate:test-results`를 실행하거나 `testDescribe` 매핑을 다시 확인하세요.

Blocks that use this component

opt-ui

AcquisitionAnalysis

Blocks

Analyze acquisition across Overview, Channels, and Campaigns tabs with metrics, trends, and tables.

opt-ui

AnalyticsDashboard

Blocks

Build an analytics dashboard with metric cards, line charts, and bar charts.

opt-ui

BillingPage

Blocks

Compose a billing overview from StatCard, BarChart, and DataTable.

opt-ui

BreakdownAnalysis

Blocks

Explore Trend, Distribution, Composition, and Data tabs with multiple charts and a DataTable.

opt-ui

PathAnalysis

Blocks

Configure user-path analysis and explore grid or Sankey flows, top paths, drop-off, patterns, entry and exit points, and dwell time.

opt-ui

ProjectOverview

Blocks

Summarize a project with metrics, navigation cards, charts, tables, code snippets, and dashboard management.

Related components

opt-charts

LineChart

Charts

Visualize trends and changes over time with a line chart for continuous data.

opt-charts

AreaChart

Charts

Display trends and time series with filled areas and optional gradients.

opt-charts

Sparkline

Charts

Show compact inline trends in stat cards, table cells, and other small spaces.

opt-charts

ScatterChart

Charts

Compare two variables in a scatter plot and optionally size points with zKey.

opt-charts

WaterfallChart

Charts

Explain changes from a starting value to a total with step bars and distinct increase, decrease, and total colors.

opt-charts

BubbleChart

Charts

Visualize three dimensions through x and y positions and bubble size using the ScatterChart renderer.

PreviousLineChartNextAreaChart