Class HiLoOpenCloseSeries
The HiLoOpenCloseSeries displays a set of OHLC segments used in financial analysis to represent open, high, low, and close values of an asset or security.
Inherited Members
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.Chart.WinUI.dll
Syntax
public class HiLoOpenCloseSeries : FinancialSeriesBase, INotifyPropertyChanged, ISegmentSpacing
Remarks
Each data point contains four values namely open, high, low, close, where the high and low are connected by a vertical line and the open and close are represented by horizontal ticks.
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:HiLoOpenCloseSeries 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();
HiLoOpenCloseSeries series = new HiLoOpenCloseSeries();
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
HiLoOpenCloseSeries()
Initializes a new instance of the HiLoOpenCloseSeries class and sets its default style key.
Declaration
public HiLoOpenCloseSeries()