Vitral 0.2.18
Charts

29 charts, drawn without a dependency

One SVG engine, no plotting library underneath, driven by the options object ApexCharts made familiar. Everything visual is plain data, so it survives JSON and a settings screen can write it. Each chart is named by a summary generated from its own data, and its plot takes focus: the arrow keys read it point by point.

Over time

Line

type="line"

One value as it moves. The chart to reach for first, and the one a reader never has to be taught.

Line, several series

type="line"

Two or three lines compare shapes. Past four, the plot becomes a knot and a small multiple reads better.

Area, stacked

type="area"

A total over time, and what it is made of. Stacked, the top edge is the total; unstacked, the fills overlap and mislead.

Range area

type="rangeArea"

The band between a low and a high, month by month: a forecast’s spread, or the day’s range. One fill, two edges.

Stream

type="stream"

A stacked area floating on a baseline of its own. The bands share the movement instead of the bottom one carrying it, which is what makes the shape readable.

Bars and a line

type="bar"

Two marks on one plot: the amount as bars, the rate as a line, each on its own axis. Every series names the mark it wants.

Candlestick

type="candlestick"

Four numbers a period: open, high, low and close. Each point is a tuple, in that order.

Calendar

type="calendar"

A year of days as a grid of weeks. A line of 365 points shows the trend; this shows the day, which is what a record of daily activity is read for.

Compared

Bar, grouped

type="bar"

Amounts side by side. The baseline has to be zero: a bar says how big, and a cut axis lies about it.

Bar, stacked

type="bar"

The total per category, split. Only the bottom band is easy to compare across categories — put the series that matters there.

Bar, to 100%

type="bar"

Shares rather than amounts: every bar is full, so the mix is comparable and the size is gone.

Bar, horizontal

type="bar"

Long category names, or many of them: the labels get the room they need and stay level.

Lollipop

type="lollipop"

A bar with the ink taken out. The same comparison at a fraction of the weight, for a page with many of them.

Waterfall

type="waterfall"

How a number got from one total to another. Each bar starts where the last one stopped; a total bar returns to zero.

Range bar

type="rangeBar"

A bar between two numbers instead of up from zero. Each point is `[low, high]`, so it reads as a span rather than an amount.

Bullet

type="bullet"

One measure, its target and the bands it falls in: a gauge’s job in a strip a table row can hold. The tick is the target, the bands are poor, fair and good.

Spread

Scatter

type="scatter"

Two measures against each other, one point a thing. What it is for is the shape of the cloud, not any one dot.

Bubble

type="bubble"

A scatter with a third number as the area. Area, not radius: doubling the radius would draw four times the quantity.

Heat map

type="heatmap"

A grid where colour is the value: two categories in, one measure out. Good for a week by an hour.

Histogram

type="histogram"

Raw readings in, counts out: the chart works out the bins itself. Pass a plain list of numbers, not categories.

Box plot

type="boxPlot"

Five numbers a category — minimum, quartiles, median, maximum — so two distributions compare without either being averaged away.

Parts of a whole

Treemap

type="treemap"

Shares of a total as areas rather than as angles. It holds many more parts than a pie, and the boxes are laid squarely so none of them is a sliver.

Radial bar

type="radialBar"

A ring a measure, as far round as its share of the maximum. Three or four at a time: they are read against their own tracks, not against each other.

Gauge

type="gauge"

One number against its maximum, with the reading in the middle. The arc leaves the bottom open, which is what tells it apart from a ring at a glance.

Sunburst

type="sunburst"

A pie of several rings, one a level of a tree. It answers what a pie cannot — what a slice is made of — without leaving the circle.

Pie

type="pie"

Shares of one total, at a glance. Three or four slices; past that the angles stop being readable and a bar is kinder.

Donut

type="donut"

A pie with the middle free, which is where the total goes. The hole is what makes it worth using.

Radar

type="radar"

A profile across the same few measures, for comparing two or three subjects on shape rather than on level.

Funnel

type="funnel"

Stages of a process, each as wide as its share of the first. What it is read for is where the drop is, so the labels carry the percentages.

Beyond the shapes

  • Zoom and brush. Drag on the plot to zoom, or pair a chart with a brush chart that selects the window.
  • Synced groups. Charts sharing a group move their tooltip and their window together.
  • Themed by tokens. Colours, grid and type come from the same tokens as the components, light and dark.
  • Without Vue. @vitral/chart mounts into any element; the Vue component is a wrapper over it.

All of it is on the Chart page