Skip to content

Axes

Draw behind axes ​

charts/draw-behind-axes
(plot) => ({
  kind: "area",
  series: pairs(plot, 1, 60, "wave"),
  gridOver: true,
})

Arguments

{ kind: "area" } is a AreaChart

A line with the region between it and the base filled.

from AreaChart
kindrequired"area"
seriesreadonly []

The series, in order.

stackedboolean

Stack the series into one filled band per category rather than drawing each to the baseline.

tooltip

The tooltip drawn at the cursor. None unless set.

from Plotting
window

How much of a growing series to show. All of it unless set.

polar

Draw the plot round a centre.

Not with ChartFrame.transposed: the two decide the same thing and polar wins, so a transposed polar chart is not transposed.

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.

from ChartFrame
x

The horizontal axis.

y

The vertical axis.

transposedboolean

Swap the plotting directions.

What makes a horizontal bar chart, which is what a ranking is almost always drawn as: names read left to right as words do, and there is room for as many as the plot is tall.

centredboolean

Draw the axis lines through the origin rather than around the edges: two rules crossing at zero with the data in four quadrants.

gridOverboolean

Draw the gridlines over the series rather than behind them.

What a chart of sparse markers over a dense field wants, where the grid is the thing being read against.

guidesreadonly []

Reference marks over the plot.

crosshairboolean

Draw a crosshair at the cursor, with a readout at each axis.

selectboolean

Let a drag across the plot select an x range, reported as a RangeSelectedEvent.

This takes the plain drag: a selectable chart brushes where an ordinary one pans. Panning one is then the shift-drag band zoom or a drag on the gutters below and beside the plot, and the double click still hands the axes back either way.

The selection stands until the viewer makes another. A shift-drag zooms without disturbing it, so a region can be kept and examined.

pick"point" | "series"

What a click selects, beyond activating the datum it hits.

from ChartScales
y2

The second vertical axis, drawn only when a series is measured against it.

x2

The second horizontal axis, drawn only when a series is measured against it.

What two runs of the same experiment want when they are the same shape over different spans: a sweep over 0 to 10 seconds beside one over 0 to 400, aligned so their features line up.

lanesnumber

Split the plot into this many bands, each with its own value axis fitted to the series in it.

How a multi-signal instrument chart is drawn: several quantities sharing one time axis, each with its own scale, so a signal moving by millivolts is readable beside one moving by volts. Overlaid on one axis the small one is a flat line.