Charts
Bar chart
Magnitude compared across periods or categories: flat columns from zero, a small radius at the data end only, a light baseline.
import { EcoBarChart } from "vue-ecosphere"
Columns
Every cap carries its value, so the chart needs no y-axis and no gridlines. Hover or focus a column for the change on the month before.
Requests closed
Against last period
The dark line across each column is last year’s figure. The dashed gridlines carry the scale, so the caps stay unlabelled.
Closed, against last year
Stacked
Parts of a whole over a few periods, separated by a 2px gap; only the top segment is rounded. The total on each cap, the latest parts in the legend.
Requests by outcome
Horizontal
The form for long category names: nothing is rotated.
Open requests by team
Emphasis and a target
October in accent, the other months in s-rest, and the target as a hairline. Only the month the chart is about carries its value.
Stacked over time, interactive
A year of periods keeps a y-axis and prints only the latest total. Focus a column: the others dim and the ChartTooltip lists every family, top segment first. Chart | Table shows the same figures as rows.
Revenue by product family
Before tax, November 2025 – October 2026
Narrow and empty
At 360px the bands narrow, bars keep 60% of them and labels thin to every other month. With no data the figure is replaced at the chart's height.
Revenue by product family
At 360px: every other month labelled
Revenue by product family
No data
No revenue recorded yet
Columns appear after the first month closes.
API
| Name | Type | Default | Description |
|---|---|---|---|
labels | string[] | — | Period or category labels on the axis. |
data | (number | null)[] | — | One series. Bars always grow from zero; null is a gap, never a zero. |
series | ChartSeries[] | — | Stacked series, bottom segment first (largest at the bottom), in s1, s2, s3. |
form | "columns" | "ghost" | "stacked" | "horizontal" | "emphasis" | "columns" | Each form answers a different question. Defaults to stacked when series is given. |
ghost | (number | null)[] | — | Last period's values: a ghost line 6 units wider than the bar on each side. |
name / ghostName | string | "This year" / "Last year" | Legend names for the ghost form. |
current | number | string | latest | Highlighted label (xl on) and, in the emphasis form, the one bar in accent. |
target / targetLabel | number / string | — | A target hairline with its label; the tooltip gives the distance from it. |
titles | string[] | — | Long period names for the tooltip and hit labels (“October 2026”). |
unit | string | — | Words after a figure: “requests closed”. |
valueFormat / capFormat / tickFormat | (v: number) => string | — | Full figures; cap labels and legend values; y ticks. |
axis | boolean | ghost, or stacked past 8 | A y-axis with nice ticks (1, 2, 2.5 or 5 × 10ⁿ, about four steps). Caps or axis, never both. |
height / width | number | 234 / measured | viewBox height; the width follows the frame (ResizeObserver) unless fixed. |
title / subtitle / caption | string | — | chart__head and a closing chart__sub. Slots head, actions and footer override them. |
ariaLabel | string | — | Label of the svg group. Each band's hit area has its own complete label. |
emptyTitle / emptyText | string | — | chart__empty at the chart's height when there is no data. |
tooltip / pointLabel | (i: number) => … | — | Override the ChartTooltip card or the hit label for a band. |
@active-change | (i: number | null) | — | The band under the pointer or focus. |