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).
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.
| Category | Opened | In progress | Closed |
|---|---|---|---|
| Mon | 44 | 13 | 11 |
| Tue | 55 | 23 | 17 |
| Wed | 41 | 20 | 15 |
| Thu | 67 | 8 | 15 |
| Fri | 22 | 13 | 21 |
| Sat | 13 | 9 | 8 |
| Sun | 18 | 6 | 12 |
Legend variants
legendVariant: dot (the default), line, pill or stat — the series totals in large type that switch to the hovered column's values.
| Category | Online | Retail |
|---|---|---|
| North | 120 | 64 |
| South | 98 | 71 |
| East | 143 | 52 |
| West | 110 | 80 |
Grouped
[stacked]="false" puts the series side by side in each category.
| Category | 2025 | 2026 |
|---|---|---|
| North | 48 | 55 |
| South | 36 | 39 |
| East | 52 | 61 |
| West | 41 | 38 |
| Central | 30 | 42 |
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.
| Category | Solved | Escalated | Open |
|---|---|---|---|
| 420 | 80 | 55 | |
| Chat | 610 | 45 | 30 |
| Phone | 230 | 60 | 25 |
| Forum | 120 | 30 | 70 |
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.
| Category | Views |
|---|---|
| Getting started | 5,400 |
| Installation | 4,100 |
| Theming and design tokens | 2,900 |
| Forms | 2,600 |
| Data table with filters and export | 2,200 |
| Icons | 1,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.
| Category | Sent | Opened |
|---|---|---|
| Jan | 12.4K | 5.2K |
| Feb | 13.1K | 5.9K |
| Mar | 12.8K | 5.6K |
| Apr | 14.9K | 6.8K |
| May | 15.2K | 7.1K |
| Jun | 16.1K | 7.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.
| Category | Income | Expenses |
|---|---|---|
| Jan | 42 | -35 |
| Feb | 38 | -41 |
| Mar | 51 | -38 |
| Apr | 47 | -52 |
| May | 55 | -44 |
| Jun | 61 | -47 |
| Jul | 58 | -60 |
| Aug | 66 | -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.
| Category | Revenue |
|---|---|
| Analytics suite | 312K |
| Billing module | 184K |
| Customer portal | 251K |
| Data warehouse | 296K |
| Email service | 98K |
| File storage | 143K |
Annotations
annotations on a column chart: an x-band covers whole categories, a y-line marks a target across the plot.
| Category | Sales |
|---|---|
| Jan | 42 |
| Feb | 51 |
| Mar | 38 |
| Apr | 64 |
| May | 70 |
| Jun | 58 |
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.
| Category | Engineering | Sales | Support | Marketing |
|---|---|---|---|---|
| Q1 | 42 | 18 | 12 | 8 |
| Q2 | 45 | 21 | 12 | 9 |
| Q3 | 51 | 24 | 14 | 9 |
| Q4 | 58 | 25 | 17 | 11 |
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.
| Category | Hosting | Tools |
|---|---|---|
| Jan | 270 | 120 |
| Feb | 280 | 95 |
| Mar | 310 | 140 |
| Apr | 305 | 150 |
Loading and empty
loading keeps the size with a skeleton; empty series (or only null values) show "No data".
Live
Changing series, stacked or horizontal redraws in place — bars slide to their new size.
| Category | Coffee | Pastry |
|---|---|---|
| Downtown | 20 | 33 |
| Airport | 37 | 50 |
| Harbor | 54 | 22 |
| Mall | 26 | 39 |
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.
| Category | Production | Staging |
|---|---|---|
| Mon | 4 | 9 |
| Tue | 6 | 12 |
| Wed | 3 | 8 |
| Thu | 7 | 11 |
| Fri | 2 | 6 |
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.
| Category | Bugs | Features |
|---|---|---|
| Core | 12 | 20 |
| Docs | 4 | 8 |
| Design | 6 | 14 |
| Infra | 9 | 5 |
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.
| Category | Plan | Fact |
|---|---|---|
| Jan | 30 | 28 |
| Feb | 32 | 35 |
| Mar | 34 | 31 |
| Apr | 36 | 39 |
| May | 38 | 41 |
Pass through
pt reaches the parts — bar, dataLabel, grid, axis, legend, legendItem, plot, tooltip and more.
| Category | Pickup | Delivery |
|---|---|---|
| Mon | 12 | 30 |
| Tue | 14 | 28 |
| Wed | 9 | 35 |
| Thu | 16 | 33 |
| Fri | 21 | 41 |
| Sat | 25 | 52 |
| Sun | 18 | 47 |
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.
| Category | Tasks |
|---|---|
| Mon | 5 |
| Tue | 8 |
| Wed | 3 |