Skip to main content

Module crosshair

Module crosshair 

Source
Expand description

The XY chart’s crosshair: a cursor that stands on a point’s x, steps to the next point a column or more away, and a readout under the plot of every series’ value there. Pure: the chart view draws it, the chart keys and a click move it.

Structs§

Entry
One entry of the readout: a name in its color and the value beside it.
PlotPlace
Where an XY plot was drawn: its cells and the x range across them, as the series’ marker divides each cell.

Enums§

Move
A move of the cursor.

Functions§

at_column
The point drawn nearest column: a click lands on what it was aimed at.
draw
The cursor: a line down the plot at x’s column, under the series, whose marks stay where they fall; and its tick on the x axis.
format_x
x as the readout writes it: in full, a date or time to the second, a number as the table writes its column.
nearest
The x among xs nearest x.
readout_lines
The readout’s lines in width cells: entries flow left to right, three cells apart, onto as many lines as they take; an entry wider than a line is cut.
step
Where the cursor at from goes: to the first point of the next column that has one, so sparse points are stepped one by one and dense ones a column at a time; or to the first or last point.
values_at
Each series’ value at x, by its points before any log: None where it has no point there, a gap in its line.
xs
The x of every point of every series, in order, each once.