Open-high-low-close Chart
Source: Data Visualisation Catalogue - Open-high-low-close Chart
Why This Belongs In The Compiler Gallery
The OHLC chart proves the new financial interval transform is reusable beyond candle bodies. It consumes the same raw ordered price ticks and renders high-low stems with open and close ticks.
Data Contract
Each raw row is one ordered price observation inside a period.
| Field | Type | Purpose |
|---|---|---|
date | temporal | Period shown on the x axis. |
sequence | ordinal/quantitative | Sort order within the session. |
price | quantitative | Raw price observation. |
open | quantitative, derived | First ordered price in the session. |
high | quantitative, derived | Maximum session price. |
low | quantitative, derived | Minimum session price. |
close | quantitative, derived | Last ordered price in the session. |
direction | categorical, derived | Gain, loss, or flat session. |
Expected Visual
Each session is shown as a vertical high-low line. The open tick extends left from the stem and the close tick extends right.
Compiler Mapping
| Compiler part | Mapping |
|---|---|
| Data source | price-ticks raw table and derived ohlc table. |
| Transform | financialInterval with groupBy, value, and orderField options. |
| Scales | x: time(date), y: linear(price), color: ordinal(direction). |
| Layers | line high-low stems, open ticks, and close ticks. |
| Guides | Generated axes, gridlines, and direction legend. |
Faithfulness Notes
The chart shares the candlestick transform contract and uses a temporal x scale. Remaining work is configurable tick orientation/width and richer stroke cap/join styling.