Skip to content

Chart types and series

Choose a renderer for the data your application has. A renderer changes how a series is drawn; it does not fetch history, subscribe to a market or change the feed’s interval. Start with the series guide for data, styling, identity and lifecycle, then try a family:

  • Candles and bars: OHLC, hollow and volume candles, and high-low.
  • Line: straight, stepped and marked scalar plots.
  • Area: scalar fills and high-low-close bands.
  • Baseline: separate colours and fills around a reference.
  • Histogram and columns: one value per column and an explicit base.
  • Transforms: Heikin-Ashi, Renko, Kagi, Line Break, Point and Figure, and range bars.

All bar series use Bar. For a scalar, Bar::from_value sets all four prices to that value and volume to zero. For OHLC, pass valid open, high, low and close prices to Bar::new; use zero volume when it is unavailable. Every ordinary bar still needs finite prices, consistent high/low bounds and finite, nonnegative volume, even if its renderer reads fewer fields.

The names below are the exact ChartType variants. “Added” describes SeriesOptions::chart_type on a normal time-based main chart.

Main typeRequired input and interpretationAdded series
CandlesOHLC; body from open to close, wick from low to highSupported
BarsOHLC; high-low stem with open/close ticksSupported
HollowCandlesOHLC; hollow when close is above openSupported
VolumeCandlesOHLC plus meaningful bar volume for body widthSupported
HighLowHigh and low; supply a valid OHLC barSupported
LineScalar, or selected price of an OHLC bar; close by defaultSupported; uses close
LineWithMarkersSame as Line, with a marker at each pointSupported; uses close
StepLineSame as Line, joined horizontally then verticallySupported; uses close
AreaScalar, or selected price of an OHLC bar; close by defaultSupported; uses close
HlcAreaHigh, low and close; supply a valid OHLC barSupported
BaselineScalar, or selected price of an OHLC bar, and a reference levelSupported; close, base at 50% of pane
ColumnsScalar in close; bar volume is not the plotted valueSupported
HeikinOriginal OHLC history; computes smoothed candles over the full historySupported
RenkoClose or high/low history, brick size and size methodConverted to Line
KagiClose or high/low history, reversal size and size methodConverted to Line
LineBreakClose or high/low history and reversal lookbackConverted to Line
PointAndFigureHigh/low by default, or close; box size, size method and reversal countConverted to Line
RangeExecutions when retained; otherwise an OHLC path approximation; range sizeConverted to Line
TimePriceOpportunityTimestamped OHLC ranges, session rules and TPO row/period settings; counts time at priceConverted to Line
VolumeFootprintExecutions with aggressor side, instrument tick size and a time-based interval, plus barsCandles only
SessionVolumeProfileSame execution inputs as footprint, session rules and the studies featureCandles only

The order-flow guide explains execution history, aggressor sides, tick sizes, session profiles and TPO. OHLCV totals do not contain executions at each price. The execution renderers draw candles without the required inputs and for bars before complete execution coverage. The oldest retained trade’s bar is complete only when the feed reports that no older trades exist. Session Volume Profile also draws candles without studies.

use egui_charts::{Chart, ChartType, model::BarData};
let mut chart = Chart::new(BarData::new());
chart.set_chart_type(ChartType::Line);

Chart::set_chart_type keeps the source bars. Change parameters with Chart::set_chart_type_params and ChartTypeParams. Keep the chart alive between frames; see your first chart.

Chart::add_series adds a host-fed bar series. Its SeriesOptions::chart_type converts Renko, Kagi, Range, Line Break, Point and Figure, and TPO to Line. Read the effective settings back with Chart::series. Footprint and Session Volume Profile are accepted as options but the added-series renderer draws their bars as candles; it does not build a second execution view.

Added series share the main time axis, including its whitespace slots. Supply the main history, or explicit whitespace, to cover their timestamps. On a time-independent main chart, added series are retained but hidden; their bar timestamps cannot share the brick or column axis. Transforms explains the other overlays hidden on that axis. Use the series lifecycle to retain and update each series by id, and scales to choose its price scale.