Skip to content

2D charts

Donut ​

charts/donut
(plot) => ({ kind: "donut", series: values(plot, 4, "one"), dial: { hole: 0.55 } })

Arguments

{ kind: "donut" } is a DonutChart

A pie with a hole.

from DonutChart
kindrequired"donut"
seriesreadonly []

The sectors, in order.

dial

The hole. A donut reads nothing else of a track.

from ChartChrome
titlestring

The title above the plot.

legendboolean

Whether a legend is drawn. Drawn unless set false.

at

The corner this chart hangs off, instead of taking its turn in the layout.

Unset, a chart fills the canvas or its cell of Grid, which is what almost every page wants. Set, the chart is placed the way an Instrument is: off that corner, at ChartChrome.size of the canvas, and out of the grid. That is what a chart drawn over a scene needs, where the rest of the canvas has to stay scene.

sizereadonly [number, number]

How much of the canvas this chart takes, as a fraction of each side.

A placed chart that names no size takes half the canvas each way, because filling it would hide whatever it was placed over. Without ChartChrome.at the layout still decides where the chart goes and this decides how much room it takes there.

offsetreadonly [number, number]

The offset from that corner, in logical pixels. Read only with ChartChrome.at.