Bar

Discrete columns — vertical, horizontal, grouped, stacked, labeled, mixed, and negative.

Bar charts compare magnitudes across categories. Compose Bar / BarRounded / BarStack with band scales from @viraui/charts.

Reach for Bar when categories are discrete. Prefer Line / Area for continuous trends, and Pie for part-to-whole without a shared baseline.


When to use

  • Monthly or named category magnitudes
  • Grouped or stacked channel comparisons
  • Values that cross zero

When not to use

  • Continuous time trends with many points → Line
  • Part-to-whole without categories on an axis → Pie

Common examples

Simple

Rounded columns with a month axis and row grid.

Y axis

Same plot with left-axis magnitude ticks.

Dense

Day-level columns with width-aware X ticks (no Y axis).

Horizontal

Band scale on Y, value on X — category labels on the left.

Multiple

Grouped desktop / mobile columns.

Stacked

Stacked channel columns.

Labels

Value labels centered above vertical columns.

Horizontal labels

Values at the end of horizontal bars.

Mixed

One active category highlighted.

Mixed horizontal

Category labels on the left; colored horizontal bars.

Negative

Columns that cross zero.

Ask your agent

Add a ViraUI bar chart of monthly visitors with hover tooltips.

  • Area — stacked continuous fill
  • Tooltips — stacked activity hover patterns

Last updated on

On this page