Candlestick Chart
Source: Data Visualisation Catalogue - Candlestick Chart
Why This Belongs In The Compiler Gallery
Candlestick charts are the first financial chart family in the compiler gallery. They exercise a reusable financial interval transform: raw price ticks compile into open, high, low, and close values before wick and body marks render the chart.
Data Contract
Each raw row is one ordered price observation inside a trading/session interval.
| 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
The chart shows one candle per session. A vertical wick spans low to high, and the body spans open to close. Color encodes whether the close is above or below the open.
Compiler Mapping
| Compiler part | Mapping |
|---|---|
| Data source | price-ticks raw table and derived ohlc table. |
| Transform | financialInterval groups by date, sorts by sequence, and computes OHLC fields. |
| Scales | x: time(date), y: linear(price), color: ordinal(direction). |
| Layers | line wicks and rect candle bodies. |
| Guides | Generated axes, gridlines, and direction legend. |
Faithfulness Notes
The core OHLC anatomy and temporal x scale are compiler-owned. Remaining work is market-session formatting, minimum visible body height for flat sessions, and richer financial annotations.