Skip to content

Bar Chart ​

Grouped or stacked bars, vertical or horizontal, with rounded corners (--radius-md by default).

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Multiple ​

Approximate web preview — the HarmonyOS rendering is the reference.

Stacked + legend ​

Only the outer ends of a stack are rounded.

Approximate web preview — the HarmonyOS rendering is the reference.

Horizontal ​

Approximate web preview — the HarmonyOS rendering is the reference.

Negative ​

Bars grow from the zero line in both directions.

Approximate web preview — the HarmonyOS rendering is the reference.

Interactive ​

Switching the series grows the new bars in.

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SBarChart ​

shadcn "Bar Chart": grouped or stacked bars, vertical or horizontal, rounded corners (barRadius, default --radius-md; stacked bars round only the outer ends).

PropTypeDefaultDescription
configSparkChartConfignew SparkChartConfig([])
dataSparkChartRow[][]
chartHeightnumber0
stackedbooleanfalse
horizontalbooleanfalsehorizontal bars (categories on the vertical axis; Recharts layout="vertical")
barRadiusnumber-1corner radius in vp; -1 → theme radius-md
gridbooleantrue
categoryAxisbooleantrue
valueAxisbooleanfalse
tooltipbooleantrue
legendbooleanfalse
indicatorSparkChartIndicator
SparkChartIndicator = 'dot' | 'line' | 'dashed'
'dot'
labelFormatter(label: string) => stringidentityLabel
valueFormatter(value: number) => stringdefaultValue
emptyTextResourceStr$r('app.string.spark_no_data')
EventTypeDefaultDescription
onActiveChange(index: number) => void() => { }

MIT Licensed