Install
@graphysdk/react and nothing else. Register the plugin once with createGraphyKit, which adds kit.geom.candlestick() and binds kit.GraphProvider to the same plugin:
One candle per session
Map the session tox, and each price to its aesthetic:
y: a highlight or a headline that reads y reads the close. A y in the root mapping does not reach the candlestick layer, and the compiler warns that it is ignored.
Horizontal
Addkit.coord.flip(). The sessions move to the vertical axis and the wicks lie across.
Body width
width sets how much of its band each body spans, as a fraction from just above 0 up to 1, like a bar’s. It defaults to 0.6; at 1 neighbouring bodies touch. The wick stays on the band centre.
1 is clamped to the full band, and one at or below 0 falls back to the default; the compiler warns in both cases.
Styling
A candle’s colour says which way its session went, so it comes from a part per direction. The bodies’ other properties and the wicks have builders of their own:stroke unless a wick entry names one. A chart-wide style.geom({ fill }) does not reach the candles, so it cannot flatten them to one colour. To colour the candles from the data instead, see Mapped colour.
Each session carries a candlestickDirection variable, 'rising' or 'falling', which replaces a data column of the same name. Name it in an entry’s where to style one direction’s bodies or wicks:
Mapped colour
color is opt-in. Map it to candlestickDirection to colour the directions through a colour scale, with a legend:
defaults entries. An overrides entry beats the mapped colour, which is why the hollow bodies above are an override. A wick follows its body’s colour unless a wick entry names one.
Hover and highlight
Hovering a session emphasises its candle, and the tooltip lists its open, high, low and close, each labelled by its column’slabel (or its key when it has none). A press anywhere along the wick takes its session.
A highlight raises each matched candle whole, wick and body together. Match on a price, or on the direction:
Not yet supported
- The editor’s chart-type picker and the chart agent. In editable mode the candlestick renders, hovers, selects and takes annotations on each session’s close, but it is authored in code.
- Data labels.
dataLabelsprints nothing on a candle yet. - Volume and OHLC bars. Draw volume as a separate bar chart; OHLC ticks in place of a body are not drawn yet.
- Aggregation. Duplicate rows for one session all draw; aggregate them first with
transform.aggregate().

