.NET MAUI Cartesian Chart Candlestick Series
The CandlestickSeries visualizes financial data, such as stock prices, as candlesticks. Each candlestick has a filled body that spans the opening and closing prices for a period.
The Candlestick Series operates with a special data in the form of four parameters defining the stock market—open, high, low, and close. Thin lines, called wicks, extend from the body to the high and low prices.
Use the CandlestickSeries when you need to make the price direction of each period easy to identify through the body fill. For a more compact alternative without filled bodies, use the OHLC Series.
Bind the Candlestick Series to Data
The CandlestickSeries reads four price values and one category value from each data item. Use the following properties to bind the series:
ItemsSource(IEnumerable)—Defines the collection of data items that the series plots.HorizontalBinding(string)—Defines the name of the data-item member that provides the category, for example, a date, plotted along the horizontal axis.OpenBinding(string)—Defines the name of the data-item member that provides the opening price.HighBinding(string)—Defines the name of the data-item member that provides the highest price.LowBinding(string)—Defines the name of the data-item member that provides the lowest price.CloseBinding(string)—Defines the name of the data-item member that provides the closing price.HorizontalAxis(Telerik.Maui.Controls.Charts.ChartAxis)—Defines the horizontal axis against which the series plots the category values.VerticalAxis(Telerik.Maui.Controls.Charts.ChartAxis)—Defines the vertical axis against which the series plots the price values.
Customize the Candlesticks
The CandlestickSeries styles each candlestick according to its price direction. A candlestick is bullish when the closing price is higher than the opening price, and bearish otherwise. Use the following properties to customize the candlesticks:
BullishFill(Brush)—Defines the fill of bullish candlestick bodies.BearishFill(Brush)—Defines the fill of bearish candlestick bodies.BullishStroke(Brush)—Defines the stroke of the outline and wicks of bullish candlesticks.BearishStroke(Brush)—Defines the stroke of the outline and wicks of bearish candlesticks.StrokeThickness(double)—Defines the thickness of the outlines and wicks in device-independent units. The default value isdouble.NaN, which applies the default thickness of the chart.
The fill and stroke properties support only
SolidColorBrushvalues. When a brush isnull, the series resolves it from the explicit style, the implicit style, and the theme defaults, in that order.
Example with Candlestick Series
The following example shows how to define a CandlestickSeries with a DateTimeAxis and a NumericalAxis.
-
Define the
CandlestickSeriesand the chart definition in Extensible Application Markup Language (XAML):XAML<charts:RadCartesianChart> <charts:RadCartesianChart.BindingContext> <local:FinancialViewModel /> </charts:RadCartesianChart.BindingContext> <charts:RadCartesianChart.Axes> <charts:DateTimeAxis LabelFormat="MMM" MajorStepUnit="Month" /> <charts:NumericalAxis Location="Left" /> </charts:RadCartesianChart.Axes> <charts:RadCartesianChart.Series> <charts:CandlestickSeries HorizontalBinding="Category" OpenBinding="Open" HighBinding="High" LowBinding="Low" CloseBinding="Close" ItemsSource="{Binding Data}" /> </charts:RadCartesianChart.Series> </charts:RadCartesianChart> -
Add the
chartsnamespace:XAMLxmlns:charts="clr-namespace:Telerik.Maui.Controls.Charts;assembly=Telerik.Maui.Controls" -
Add the data model that exposes the
Category,Open,High,Low, andCloseproperties:C#public class OhlcDataPoint : NotifyPropertyChangedBase { private DateTime category; private double open; private double high; private double low; private double close; public DateTime Category { get { return this.category; } set { if (value != this.category) { this.category = value; this.OnPropertyChanged(); } } } public double Open { get { return this.open; } set { if (value != this.open) { this.open = value; this.OnPropertyChanged(); } } } public double High { get { return this.high; } set { if (value != this.high) { this.high = value; this.OnPropertyChanged(); } } } public double Low { get { return this.low; } set { if (value != this.low) { this.low = value; this.OnPropertyChanged(); } } } public double Close { get { return this.close; } set { if (value != this.close) { this.close = value; this.OnPropertyChanged(); } } } } -
Add the
ViewModelthat populates the data collection:C#public class FinancialViewModel { public FinancialViewModel() { this.Data = new ObservableCollection<OhlcDataPoint> { new OhlcDataPoint { Category = new DateTime(2024, 1, 1), Open = 5, High = 10, Low = 2, Close = 8 }, new OhlcDataPoint { Category = new DateTime(2024, 2, 1), Open = 7, High = 15, Low = 3, Close = 5 }, new OhlcDataPoint { Category = new DateTime(2024, 3, 1), Open = 15, High = 20, Low = 10, Close = 19 }, new OhlcDataPoint { Category = new DateTime(2024, 4, 1), Open = 2, High = 7, Low = 1, Close = 5 }, new OhlcDataPoint { Category = new DateTime(2024, 5, 1), Open = 15, High = 25, Low = 10, Close = 12 }, new OhlcDataPoint { Category = new DateTime(2024, 6, 1), Open = 12, High = 18, Low = 9, Close = 16 }, new OhlcDataPoint { Category = new DateTime(2024, 7, 1), Open = 16, High = 22, Low = 11, Close = 13 }, }; } public ObservableCollection<OhlcDataPoint> Data { get; } }
The following image shows the result, with monthly candlesticks from January to July:

For a runnable example with the Cartesian Chart candlestick series, go to the SDKBrowser Demo Application and navigate to the Charts > Series category.
Known Limitations
The CandlestickSeries does not support data point labels.