Charts / Step line chart

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

NameTypeDefaultDescription
pointsStepPoint[]—Each an effective date (or a version) and the value from then on.
unitstring—Words after the value: “per unit”.
axisLabelstring—The unit at the top left: “USD per unit”.
xTitlestring"Effective date" / "Version"Axis title at the bottom left.
valueFormat(v: number) => string—Value labels, ticks, tooltip and hit labels.
height / widthnumber228 / measuredviewBox size. Labels thin to the measured width.
title / subtitle / caption / ariaLabelstring—Head, closing chart__sub and the svg label.
emptyTitle / emptyTextstring—chart__empty when there are no points.
tooltip(i: number) => ChartTooltipData—Override the card for a point.