For the complete documentation index, see llms.txt. This page is also available as Markdown.

CandlestickCartesianLayer

Use CandlestickCartesianLayer to create candlestick charts. Instantiate it via rememberCandlestickCartesianLayer.

Each candle’s style is defined by its corresponding Candle instance. These are provided by CandleProvider:

  • To style candles based on their absolute price changes (closing vs. opening), use absolute. This is commonly used for filled candles and provides corresponding defaults.

  • To style candles based on both their absolute price changes (closing vs. opening) and their relative price changes (closing vs. previous closing), use absoluteRelative. This is commonly used for hollow candles and provides corresponding defaults.

  • For custom behavior, implement CandleProvider.

In rememberCandlestickCartesianLayer, you can set the minimum body height, change the candle spacing, and toggle wick scaling. For an example, see the “Gold prices (12/30/2024)” sample chart.

Transaction.candlestickModel

Candlestick layers use CandlestickCartesianLayerModel instances. When using CartesianChartModelProducer, add them via candlestickModel:

candlestickModel also has an overload with no x parameter, which uses the indices of the prices as the x-values:

Manual CandlestickCartesianLayerModel creation

When creating a CartesianChartModel instance directly, you can add a candlestick-layer model by using build:

This function also has an overload with no x parameter:

Last updated