Skip to main content

Module candlestick

Module candlestick 

Source
Expand description

Candlestick (OHLC) chart. Each bar is an open/high/low/close tuple drawn as a wick (high→low) + a body (open↔close), coloured up/down from theme colours. The price→pixel mapping (OhlcLayout) is a pure function with tests so the geometry is verifiable headlessly.

Structs§

CandlestickView
A candlestick chart over a series of OHLC bars.
Ohlc
One OHLC bar. label is the x-axis tick (e.g. a date).
OhlcLayout
The price→pixel mapping for a candlestick chart: where each bar’s x-centre sits, the body half-width, and a y_of(price) closure source. Pure data so it can be asserted without a painter.