Install
@graphysdk/react and React. 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 neighboring bodies touch. The wick stays on the band center.
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 color 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 color. To color the candles from the data instead, see Mapped color.
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 color
color is opt-in. Map it to candlestickDirection to color the directions through a color scale, with a legend:
defaults entries. An overrides entry outranks the mapped color, which is why the hollow bodies above are an override. A wick follows its body’s color unless a wick entry names one.
Hover and highlight
Hovering a session emphasizes its candle, and the tooltip lists its open, high, low and close, each labeled by its column’slabel (or its key when it has none). A press anywhere on the candle, body or 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 annotate 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().

