Column Chart

Columns or horizontal bars for comparing values across categories — stacked, 100% stacked or grouped side by side. Drawn as SVG by the component, rendered on the server and themed by the design tokens.

Part of @tectra-ng/charts (npm install @tectra-ng/charts, also included in tectra-ng).

Features18APIThemingAccessibility

Basic

Series are stacked by default. Hover a column: it stays bright, the others fade, and the tooltip shows every segment with the total. The arrow keys move through the columns too.

Arrow keys move between values
Tickets by weekday. Column chart, 3 series, 7 values, from 6 to 67
CategoryOpenedIn progressClosed
Mon441311
Tue552317
Wed412015
Thu67815
Fri221321
Sat1398
Sun18612

Legend variants

legendVariant: dot (the default), line, pill or stat — the series totals in large type that switch to the hovered column's values.

Arrow keys move between values
Legend variants. Column chart, 2 series, 4 values, from 52 to 143
CategoryOnlineRetail
North12064
South9871
East14352
West11080

Grouped

[stacked]="false" puts the series side by side in each category.

Arrow keys move between values
Sales by region, this year and last year. Column chart, 2 series, 5 values, from 30 to 61
Category20252026
North4855
South3639
East5261
West4138
Central3042

Percent

stackType="100%" stacks every category to 100%, so the shares compare across categories; the value axis turns into percents and the tooltip keeps the real values.

Arrow keys move between values
Ticket outcome by channel. Column chart, 3 series, 4 values, from 25 to 610
CategorySolvedEscalatedOpen
Email4208055
Chat6104530
Phone2306025
Forum1203070

Horizontal

horizontal turns the columns into bars — better for long category names, which are cut at maxLabelWidth (220px) with the full name in a hint.

Arrow keys move between values
Views by page. Bar chart, 1 series, 6 values, from 1,500 to 5,400
CategoryViews
Getting started5,400
Installation4,100
Theming and design tokens2,900
Forms2,600
Data table with filters and export2,200
Icons1,500

Data labels

dataLabels writes each value on its bar; a label that does not fit a stacked segment is left out, grouped bars put it above the bar.

Arrow keys move between values
Newsletter reach. Column chart, 2 series, 6 values, from 5.2K to 16.1K
CategorySentOpened
Jan12.4K5.2K
Feb13.1K5.9K
Mar12.8K5.6K
Apr14.9K6.8K
May15.2K7.1K
Jun16.1K7.6K

Negative

Negative values grow down from the zero line, which is drawn when the range crosses zero; stacks split into a positive and a negative part.

Arrow keys move between values
Cash flow by month. Column chart, 2 series, 8 values, from -60 to 66
CategoryIncomeExpenses
Jan42-35
Feb38-41
Mar51-38
Apr47-52
May55-44
Jun61-47
Jul58-60
Aug66-49

Axes

Axis titles, the category axis on top with xAxisPosition, grid lines, a fixed range with yMax, compact numbers on the value axis, and labelMode="rotate" for long category labels.

Arrow keys move between values
Revenue by product. Column chart, 1 series, 6 values, from 98K to 312K
CategoryRevenue
Analytics suite312K
Billing module184K
Customer portal251K
Data warehouse296K
Email service98K
File storage143K

Annotations

annotations on a column chart: an x-band covers whole categories, a y-line marks a target across the plot.

Arrow keys move between values
Sales against the plan. Column chart, 1 series, 6 values, from 38 to 70
CategorySales
Jan42
Feb51
Mar38
Apr64
May70
Jun58

Legend

A legend item hides or shows its series and the axis rescales; hovering an item fades the other series. legendPosition and legendAlign place it; seriesToggle reports changes.

Arrow keys move between values
Headcount by department. Column chart, 4 series, 4 values, from 8 to 58
CategoryEngineeringSalesSupportMarketing
Q14218128
Q24521129
Q35124149
Q458251711

Click a legend item.

Tooltip formatter

tooltipFormatter gets the value and its position (seriesIndex, dataPointIndex), so it can show related data — here the amount in the original currency.

Arrow keys move between values
Spending in euro. Column chart, 2 series, 4 values, from 95 to 310
CategoryHostingTools
Jan270120
Feb28095
Mar310140
Apr305150

Loading and empty

loading keeps the size with a skeleton; empty series (or only null values) show "No data".

No data

Live

Changing series, stacked or horizontal redraws in place — bars slide to their new size.

Arrow keys move between values
Units sold by store. Column chart, 2 series, 4 values, from 20 to 54
CategoryCoffeePastry
Downtown2033
Airport3750
Harbor5422
Mall2639

Fill parent

height="100%" fills a parent with a definite height — a dashboard tile, a grid cell — and redraws on resize. Drag the corner of the box.

Arrow keys move between values
Deploys per day. Column chart, 2 series, 5 values, from 2 to 12
CategoryProductionStaging
Mon49
Tue612
Wed38
Thu711
Fri26

Accessibility

Tab to the chart: ←/→ move between categories, ↑/↓ between the series of a stack (in a horizontal chart the keys swap), Home / End jump to the ends, Escape closes the tooltip. Each bar is announced; screen readers also get a summary and a hidden data table.

Arrow keys move between values
Open issues by team. Column chart, 2 series, 4 values, from 4 to 20
CategoryBugsFeatures
Core1220
Docs48
Design614
Infra95

Design tokens

dt sets the bar radius, the bar width (share of the category), the gap between grouped bars, the gap between stacked segments and the palette of one chart.

Arrow keys move between values
Plan and fact. Column chart, 2 series, 5 values, from 28 to 41
CategoryPlanFact
Jan3028
Feb3235
Mar3431
Apr3639
May3841

Pass through

pt reaches the parts — bar, dataLabel, grid, axis, legend, legendItem, plot, tooltip and more.

Arrow keys move between values
Orders by day. Column chart, 2 series, 7 values, from 9 to 52
CategoryPickupDelivery
Mon1230
Tue1428
Wed935
Thu1633
Fri2141
Sat2552
Sun1847

Unstyled

unstyled removes the tectra styles: no tokens, no rounding, no motion — the geometry, the colours of the series, the tooltip and the keyboard stay, ready for your own CSS.

Arrow keys move between values
Unstyled chart. Column chart, 1 series, 3 values, from 3 to 8
CategoryTasks
Mon5
Tue8
Wed3