alexa
menu

WinUI

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download

    Show / Hide Table of Contents

    Class CandleSeries

    The CandleSeries represents a candlestick chart series used in financial analysis to visualize open, high, low, and close values of an asset or security.

    Inheritance
    System.Object
    ChartSeries
    CartesianSeries
    FinancialSeriesBase
    CandleSeries
    Implements
    System.ComponentModel.INotifyPropertyChanged
    ISegmentSpacing
    Inherited Members
    CartesianSeries.DataLabelSettings
    CartesianSeries.DataLabelSettingsProperty
    CartesianSeries.OnApplyTemplate()
    CartesianSeries.ShowTrackballLabel
    CartesianSeries.ShowTrackballLabelProperty
    CartesianSeries.XAxisName
    CartesianSeries.XAxisNameProperty
    CartesianSeries.YAxisName
    CartesianSeries.YAxisNameProperty
    ChartSeries.ActualXAxis
    ChartSeries.ActualYAxis
    ChartSeries.AnimationDuration
    ChartSeries.AnimationDurationProperty
    ChartSeries.Chart
    ChartSeries.EnableAnimation
    ChartSeries.EnableAnimationProperty
    ChartSeries.EnableTooltip
    ChartSeries.EnableTooltipProperty
    ChartSeries.Fill
    ChartSeries.FillProperty
    ChartSeries.IsSeriesVisible
    ChartSeries.IsSeriesVisibleProperty
    ChartSeries.IsVisibleOnLegend
    ChartSeries.IsVisibleOnLegendProperty
    ChartSeries.ItemsSource
    ChartSeries.ItemsSourceProperty
    ChartSeries.Label
    ChartSeries.LabelProperty
    ChartSeries.LegendIcon
    ChartSeries.LegendIconProperty
    ChartSeries.LegendIconTemplate
    ChartSeries.LegendIconTemplateProperty
    ChartSeries.ListenPropertyChange
    ChartSeries.ListenPropertyChangeProperty
    ChartSeries.OnPointerExited(PointerRoutedEventArgs)
    ChartSeries.OnPointerMoved(PointerRoutedEventArgs)
    ChartSeries.OnPointerPressed(PointerRoutedEventArgs)
    ChartSeries.OnPointerReleased(PointerRoutedEventArgs)
    ChartSeries.OnTapped(TappedRoutedEventArgs)
    ChartSeries.PaletteBrushes
    ChartSeries.PaletteBrushesProperty
    ChartSeries.PropertyChanged
    ChartSeries.ResumeNotification()
    ChartSeries.SelectionBehavior
    ChartSeries.SelectionBehaviorProperty
    ChartSeries.ShowDataLabels
    ChartSeries.ShowDataLabelsProperty
    ChartSeries.SpacingProperty
    ChartSeries.SuspendNotification()
    ChartSeries.TooltipTemplate
    ChartSeries.TooltipTemplateProperty
    ChartSeries.TrackballLabelTemplate
    ChartSeries.TrackballLabelTemplateProperty
    ChartSeries.XBindingPath
    ChartSeries.XBindingPathProperty
    FinancialSeriesBase.AddAdornments(Double, ChartPoint, ChartPoint, ChartPoint, ChartPoint, ChartPoint, ChartPoint, Int32, Double, Boolean)
    FinancialSeriesBase.BearishBrush
    FinancialSeriesBase.BearishBrushProperty
    FinancialSeriesBase.BullishBrush
    FinancialSeriesBase.BullishBrushProperty
    FinancialSeriesBase.Close
    FinancialSeriesBase.CloseProperty
    FinancialSeriesBase.CloseValues
    FinancialSeriesBase.High
    FinancialSeriesBase.HighProperty
    FinancialSeriesBase.HighValues
    FinancialSeriesBase.ISegmentSpacing.CalculateSegmentSpacing(Double, Double, Double)
    FinancialSeriesBase.Low
    FinancialSeriesBase.LowProperty
    FinancialSeriesBase.LowValues
    FinancialSeriesBase.Open
    FinancialSeriesBase.OpenProperty
    FinancialSeriesBase.OpenValues
    FinancialSeriesBase.SegmentSpacing
    FinancialSeriesBase.SegmentSpacingProperty
    FinancialSeriesBase.SegmentWidth
    FinancialSeriesBase.SegmentWidthProperty
    FinancialSeriesBase.WidthFactor
    Namespace: Syncfusion.UI.Xaml.Charts
    Assembly: Syncfusion.Chart.WinUI.dll
    Syntax
    public class CandleSeries : FinancialSeriesBase, INotifyPropertyChanged, ISegmentSpacing
    Remarks

    Each data point contains four values namely open, high, low, close. Typically, the high and low values are connected using a vertical straight line, whereas the region between open and close values are connected using a vertical column segment. The hollow‑candle rendering style can be disabled by setting EnableSolidCandle.

    It provides options for customizing the appearance of the segments, such as setting different BullishBrush and BearishBrush, and supports data labels to display values on the chart. Use the Fill property to apply a single fill color to all segments. Note that the PaletteBrushes collection is not applied to financial segments.

    Examples
        <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()

    Initializes a new instance of the CandleSeries class and sets its default style key.

    Declaration
    public CandleSeries()

    Fields

    EnableSolidCandleProperty

    The DependencyProperty for EnableSolidCandle property.

    Declaration
    public static readonly DependencyProperty EnableSolidCandleProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    StrokeProperty

    The DependencyProperty for Stroke property.

    Declaration
    public static readonly DependencyProperty StrokeProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    Properties

    EnableSolidCandle

    Gets or sets a value indicating whether solid candle rendering is enabled.

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

    The default value is false

    Examples
        <chart:SfCartesianChart>
    
            <chart:CandleSeries ItemsSource="{Binding Data}"
                                XBindingPath="XValue"
                                High="High"
                                Low="Low"
                                Open="Open"
                                Close="Close"
                                EnableSolidCandle="True"/>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        CandleSeries candleSeries = new CandleSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              High = "High",
              Low = "Low",
              Open = "Open",
              Close = "Close",
              EnableSolidCandle = true
        };
    
        chart.Series.Add(candleSeries);

    Stroke

    Gets or sets the stroke color of the candle segments.

    Declaration
    public Brush Stroke { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Media.Brush

    The default value is null

    Examples
        <chart:SfCartesianChart>
    
            <chart:CandleSeries ItemsSource="{Binding Data}"
                                XBindingPath="XValue"
                                High="High"
                                Low="Low"
                                Open="Open"
                                Close="Close"
                                Stroke="Magenta"/>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        CandleSeries candleSeries = new CandleSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              High = "High",
              Low = "Low",
              Open = "Open",
              Close = "Close",
              Stroke = new SolidColorBrush(Colors.Magenta)
        };
    
        chart.Series.Add(candleSeries);

    Implements

    System.ComponentModel.INotifyPropertyChanged
    ISegmentSpacing
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved