menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class CandleSeries - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class CandleSeries

    The CandleSeries displays a set of candle used in financial analysis to represent open, high, low, and close values of an asset or security.

    Inheritance
    System.Object
    ChartSeries
    CartesianSeries
    FinancialSeriesBase
    HiLoOpenCloseSeries
    CandleSeries
    Inherited Members
    CartesianSeries.ActualXAxis
    CartesianSeries.ActualYAxis
    CartesianSeries.DataLabelSettings
    CartesianSeries.DataLabelSettingsProperty
    CartesianSeries.GetDataPoints(Double, Double, Double, Double)
    CartesianSeries.GetDataPoints(Rect)
    CartesianSeries.Label
    CartesianSeries.LabelProperty
    CartesianSeries.OnBindingContextChanged()
    CartesianSeries.ShowTrackballLabel
    CartesianSeries.ShowTrackballLabelProperty
    CartesianSeries.TrackballLabelTemplate
    CartesianSeries.TrackballLabelTemplateProperty
    CartesianSeries.XAxisName
    CartesianSeries.XAxisNameProperty
    CartesianSeries.YAxisName
    CartesianSeries.YAxisNameProperty
    ChartSeries.CreateAnimation(Action<Double>)
    ChartSeries.DrawDataLabel(ICanvas, Brush, String, PointF, Int32)
    ChartSeries.DrawSeries(ICanvas, ReadOnlyObservableCollection<ChartSegment>, RectF)
    ChartSeries.EnableAnimation
    ChartSeries.EnableAnimationProperty
    ChartSeries.EnableTooltip
    ChartSeries.EnableTooltipProperty
    ChartSeries.Fill
    ChartSeries.FillProperty
    ChartSeries.GetDataPointIndex(Single, Single)
    ChartSeries.IsVisible
    ChartSeries.IsVisibleOnLegend
    ChartSeries.IsVisibleOnLegendProperty
    ChartSeries.IsVisibleProperty
    ChartSeries.ItemsSource
    ChartSeries.ItemsSourceProperty
    ChartSeries.LabelContext
    ChartSeries.LabelContextProperty
    ChartSeries.LabelTemplate
    ChartSeries.LabelTemplateProperty
    ChartSeries.LegendIcon
    ChartSeries.LegendIconProperty
    ChartSeries.OnParentSet()
    ChartSeries.Opacity
    ChartSeries.OpacityProperty
    ChartSeries.PaletteBrushes
    ChartSeries.PaletteBrushesProperty
    ChartSeries.SelectionBehavior
    ChartSeries.SelectionBehaviorProperty
    ChartSeries.ShowDataLabels
    ChartSeries.ShowDataLabelsProperty
    ChartSeries.TooltipTemplate
    ChartSeries.TooltipTemplateProperty
    ChartSeries.XBindingPath
    ChartSeries.XBindingPathProperty
    ChartSeries.XRange
    ChartSeries.YRange
    FinancialSeriesBase.BearishFill
    FinancialSeriesBase.BearishFillProperty
    FinancialSeriesBase.BullishFill
    FinancialSeriesBase.BullishFillProperty
    FinancialSeriesBase.Close
    FinancialSeriesBase.CloseProperty
    FinancialSeriesBase.High
    FinancialSeriesBase.HighProperty
    FinancialSeriesBase.Low
    FinancialSeriesBase.LowProperty
    FinancialSeriesBase.Open
    FinancialSeriesBase.OpenProperty
    FinancialSeriesBase.Spacing
    FinancialSeriesBase.SpacingProperty
    FinancialSeriesBase.Width
    FinancialSeriesBase.WidthProperty
    Namespace: Syncfusion.Maui.Charts
    Assembly: Syncfusion.Maui.Charts.dll
    Syntax
    public class CandleSeries : HiLoOpenCloseSeries, IDatapointSelectionDependent, ITooltipDependent, IDataTemplateDependent, IDrawCustomLegendIcon
    Remarks

    To render a series, create an instance of CandleSeries class, and add it to the Series collection.

    It provides options for Fill, PaletteBrushes, StrokeWidth, Stroke, and Opacity to customize the appearance.

    EnableTooltip - A tooltip displays information while tapping or mouse hovering above a segment. To display the tooltip on a chart, you need to set the EnableTooltip property as true in CandleSeries class, and also refer TooltipBehavior property.

    Animation - To animate the series, set True to the EnableAnimation property.

    LegendIcon - To customize the legend icon using the LegendIcon property.

    Examples
    • Xaml
    • C#
    • ViewModel
        <chart:SfCartesianChart>
    
              <chart:SfCartesianChart.XAxes>
                  <chart:CategoryAxis/>
              </chart:SfCartesianChart.XAxes>
    
              <chart:SfCartesianChart.YAxes>
                  <chart:NumericalAxis/>
              </chart:SfCartesianChart.YAxes>
    
                  <chart:CandleSeries
                      ItemsSource="{Binding Data}"
                      XBindingPath="XValue"
                      High="High"
                      Low="Low"
                      Open="Open"
                      Close="Close"/>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
    
        CategoryAxis xAxis = new CategoryAxis();
        NumericalAxis yAxis = new NumericalAxis();
    
        chart.XAxes.Add(xAxis);
        chart.YAxes.Add(yAxis);
    
        ViewModel viewModel = new ViewModel();
    
        CandleSeries series = new CandleSeries();
        series.ItemsSource = viewModel.Data;
        series.XBindingPath = "XValue";
        series.High = "High";
        series.Low = "Low";
        series.Open = "Open";
        series.Close = "Close";
        chart.Series.Add(series);
        public ObservableCollection<Model> Data { get; set; }
    
        public ViewModel()
        {
           Data = new ObservableCollection<Model>();
           Data.Add(new Model() { XValue = "2000", High = 50, Low = 40, Open = 47, Close = 45});
           Data.Add(new Model() { XValue = "2001", High = 50, Low = 35, Open = 45, Close = 40});
           Data.Add(new Model() { XValue = "2002", High = 45, Low = 30, Open = 37, Close = 40 });
           Data.Add(new Model() { XValue = "2003", High = 50, Low = 35, Open = 40, Close = 45});
           Data.Add(new Model() { XValue = "2004", High = 45, Low = 30, Open = 35, Close = 32 });
           Data.Add(new Model() { XValue = "2005", High = 50, Low = 35, Open = 40, Close = 45 });
           Data.Add(new Model() { XValue = "2006", High = 40, Low = 31, Open = 36, Close = 34 });
           Data.Add(new Model() { XValue = "2007", High = 48, Low = 38, Open = 43, Close = 40});
           Data.Add(new Model() { XValue = "2008", High = 55, Low = 45, Open = 48, Close = 50});
           Data.Add(new Model() { XValue = "2009", High = 45, Low = 30, Open = 35, Close = 40});
           Data.Add(new Model() { XValue = "2010", High = 50, Low = 50, Open = 50, Close = 50 });
        }

    Constructors

    CandleSeries()

    Declaration
    public CandleSeries()

    Fields

    EnableSolidCandleProperty

    Identifies the EnableSolidCandle bindable property.

    Declaration
    public static readonly BindableProperty EnableSolidCandleProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    StrokeProperty

    Identifies the Stroke bindable property.

    Declaration
    public static readonly BindableProperty StrokeProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    Properties

    EnableSolidCandle

    Gets or sets a value indicating a wheather enable solid candles.

    Declaration
    public bool EnableSolidCandle { get; set; }
    Property Value
    Type Description
    System.Boolean

    Its default value is False.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
             <chart:CandleSeries ItemsSource="{Binding Data}"
                                 XBindingPath="XValue"
                                 High="High"
                                 Low="Low"
                                 Open="Open"
                                 Close="Close"
                                 EnableSolidCandles="True"/>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        CandleSeries series = new CandleSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              High = "High",
              Low = "Low",
              Open = "Open",
              Close = "Close",
              EnableSolidCandles = "True",
        };
    
        chart.Series.Add(series);

    Stroke

    Gets or sets the stroke to the candle data point.

    Declaration
    public Brush Stroke { get; set; }
    Property Value
    Type
    Microsoft.Maui.Controls.Brush
    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
             <chart:CandleSeries ItemsSource="{Binding Data}"
                                 XBindingPath="XValue"
                                 High="High"
                                 Low="Low"
                                 Open="Open"
                                 Close="Close"
                                 Stroke="Red" />
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        CandleSeries series = new CandleSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              High = "High",
              Low = "Low",
              Open = "Open",
              Close = "Close",
              Stroke = new SolidColorBrush(Colors.Red),
        };
    
        chart.Series.Add(series);

    Methods

    CreateSegment()

    Declaration
    protected override ChartSegment CreateSegment()
    Returns
    Type
    ChartSegment
    Overrides
    HiLoOpenCloseSeries.CreateSegment()

    See Also

    CandleSegment
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved