Charts
Step line chart
A value that holds until it changes — a price, a rate, a tier — drawn step-after with a hollow marker and its value at each change.
import { EcoStepLineChart } from "vue-ecosphere"
By effective date
x is proportional to time, so a long gap between changes reads as a long flat. A fall puts its label below the marker.
Price per unit
Every agreed change, placed by effective date
By version
When the dates cannot be trusted, space by version, title the axis “Version” and say so in the sub-title.
Price per seat
By contract version, evenly spaced: the dates are not known
One point, narrow and empty
A single marker and its value with no line; at 360px the labels thin and the markers stay.
Price per unit
At 360px
Price per unit
One price so far
Price per unit
No changes yet
The line starts when the first price takes effect.
API
| Name | Type | Default | Description |
|---|---|---|---|
points | StepPoint[] | — | Each an effective date (or a version) and the value from then on. |
unit | string | — | Words after the value: “per unit”. |
axisLabel | string | — | The unit at the top left: “USD per unit”. |
xTitle | string | "Effective date" / "Version" | Axis title at the bottom left. |
valueFormat | (v: number) => string | — | Value labels, ticks, tooltip and hit labels. |
height / width | number | 228 / measured | viewBox size. Labels thin to the measured width. |
title / subtitle / caption / ariaLabel | string | — | Head, closing chart__sub and the svg label. |
emptyTitle / emptyText | string | — | chart__empty when there are no points. |
tooltip | (i: number) => ChartTooltipData | — | Override the card for a point. |