Get StartedComponentsStylingThemingMath & Science
MCP

Charts

Bar Chart

Grouped, stacked and percent bars, plus range, histogram, candlestick and single-bar segments.

Markdown

Import

tsx
import { BarChart, BarSegment, CandlestickChart, Histogram, RangeBarChart } from "@indoku/ui"

Examples

Grouped

050100150200250300JanFebMarAprMayJun

Stacked

050100150200250300JanFebMarAprMayJun

Percent

Each bar is normalized to 100%.

020406080100JanFebMarAprMayJun

Range

Floating bars from min to max.

050100150200JanFebMarAprMayJun

Histogram

Raw values are binned for you.

051015202508.34416.6925.0333.3741.7250.0658.4166.7575.09

Candlestick

OHLC data; green when close is at or above open.

020406080100120140MonTueWedThuFri

Bar segment

One horizontal bar split by share, with a legend.

Props

BarChart

PropTypeDefaultDescription
mode'grouped' | 'stacked' | 'percent''grouped'How series combine.
gapnumber0.3Gap between groups, 0-1.
joinedbooleanfalseNo gap (histogram look).

Other bar charts

PropTypeDefaultDescription
dataRangeDatum[] | CandleDatum[] | BarSegmentDatum[]–Data for RangeBarChart, CandlestickChart and BarSegment.
values / binsnumber[] / number–Histogram input.

* required. Style props and HTML attributes are accepted as well.

Created by @indokudev