MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class CartesianSeries

    Show / Hide Table of Contents

    Class CartesianSeries

    CartesianSeries is the base class for all cartesian charts such as column, line, area, and so on.

    Inheritance
    System.Object
    ChartSeries
    CartesianSeries
    RangeSeriesBase
    XYDataSeries
    Inherited Members
    ChartSeries.ItemsSourceProperty
    ChartSeries.XBindingPathProperty
    ChartSeries.FillProperty
    ChartSeries.PaletteBrushesProperty
    ChartSeries.IsVisibleProperty
    ChartSeries.OpacityProperty
    ChartSeries.EnableAnimationProperty
    ChartSeries.EnableTooltipProperty
    ChartSeries.TooltipTemplateProperty
    ChartSeries.ShowDataLabelsProperty
    ChartSeries.LegendIconProperty
    ChartSeries.IsVisibleOnLegendProperty
    ChartSeries.SelectionBehaviorProperty
    ChartSeries.GetDataPointIndex(Single, Single)
    ChartSeries.CreateSegment()
    ChartSeries.CreateAnimation(Action<Double>)
    ChartSeries.DrawDataLabel(ICanvas, Brush, String, PointF, Int32)
    ChartSeries.DrawSeries(ICanvas, ReadOnlyObservableCollection<ChartSegment>, RectF)
    ChartSeries.ItemsSource
    ChartSeries.XBindingPath
    ChartSeries.Fill
    ChartSeries.PaletteBrushes
    ChartSeries.IsVisible
    ChartSeries.Opacity
    ChartSeries.EnableAnimation
    ChartSeries.EnableTooltip
    ChartSeries.TooltipTemplate
    ChartSeries.ShowDataLabels
    ChartSeries.LegendIcon
    ChartSeries.IsVisibleOnLegend
    ChartSeries.SelectionBehavior
    ChartSeries.XRange
    ChartSeries.YRange
    Namespace: Syncfusion.Maui.Charts
    Assembly: Syncfusion.Maui.Charts.dll
    Syntax
    public abstract class CartesianSeries : ChartSeries, IDatapointSelectionDependent, ITooltipDependent

    Constructors

    CartesianSeries()

    Initializes a new instance of the CartesianSeries.

    Declaration
    public CartesianSeries()

    Fields

    DataLabelSettingsProperty

    Identifies the DataLabelSettings bindable property.

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

    LabelProperty

    Identifies the Label bindable property.

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

    ShowTrackballLabelProperty

    Identifies the ShowTrackballLabel bindable property.

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

    XAxisNameProperty

    Identifies the XAxisName bindable property.

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

    YAxisNameProperty

    Identifies the YAxisName bindable property.

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

    Properties

    ActualXAxis

    Gets the actual XAxis value.

    Declaration
    public ChartAxis ActualXAxis { get; }
    Property Value
    Type Description
    ChartAxis

    ActualYAxis

    Gets the actual YAxis value.

    Declaration
    public ChartAxis ActualYAxis { get; }
    Property Value
    Type Description
    ChartAxis

    DataLabelSettings

    Gets or sets a value to customize the appearance of the displaying data labels in the cartesian series.

    Declaration
    public CartesianDataLabelSettings DataLabelSettings { get; set; }
    Property Value
    Type Description
    CartesianDataLabelSettings

    It takes the CartesianDataLabelSettings.

    Remarks

    This allows us to change the look of the displaying labels' content, and shapes at the data point.

    Examples
    • MainWindow.xaml
    • MainWindow.cs
        <chart:SfCartesianChart>
    
              <chart:SfCartesianChart.XAxes>
                  <chart:NumericalAxis/>
              </chart:SfCartesianChart.XAxes>
    
              <chart:SfCartesianChart.YAxes>
                  <chart:NumericalAxis/>
              </chart:SfCartesianChart.YAxes>
    
              <chart:SfCartesianChart.Series>
                  <chart:ColumnSeries ItemsSource="{Binding Data}"
                                      XBindingPath="XValue"
                                      YBindingPath="YValue"
                                      ShowDataLabels="True">
                       <chart:ColumnSeries.DataLabelSettings>
                            <chart:CartesianDataLabelSettings BarAlignment="Middle" />
                       </ chart:ColumnSeries.DataLabelSettings>
                  </chart:ColumnSeries> 
              </chart:SfCartesianChart.Series>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
    
        NumericalAxis xAxis = new NumericalAxis();
        NumericalAxis yAxis = new NumericalAxis();
    
        chart.XAxes.Add(xAxis);
        chart.YAxes.Add(yAxis);
    
        ColumnSeries series = new ColumnSeries();
        series.ItemsSource = viewmodel.Data;
        series.XBindingPath = "XValue";
        series.YBindingPath = "YValue";
        series.ShowDataLabels = "True";
    
        series.DataLabelSettings = new CartesianDataLabelSettings()
        {
            BarAlignment = DataLabelAlignment.Middle,
        };
        chart.Series.Add(series);

    Label

    Gets or sets a value that will be displayed in the associated legend item.

    Declaration
    public string Label { get; set; }
    Property Value
    Type Description
    System.String

    It accepts a string value and its default value is string.Empty.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <!-- ... Eliminated for simplicity-->
    
             <chart:ColumnSeries ItemsSource="{Binding Data}"
                               XBindingPath="XValue"
                               YBindingPath="YValue"
                               Label = "ColumnSeries"/>
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        // Eliminated for simplicity
    
        ColumnSeries columnSeries = new ColumnSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              Label = "ColumnSeries",
        };
    
        chart.Series.Add(columnSeries);

    ShowTrackballLabel

    Gets or sets whether to show trackball label on the corresponding series

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

    XAxisName

    Gets or sets the name of the (horizontal) axis in the XAxes collection which is used to plot the series with particular axis.

    Declaration
    public string XAxisName { get; set; }
    Property Value
    Type Description
    System.String

    It takes the string value and its default value is null.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <chart:SfCartesianChart.XAxes>
           <chart:CategoryAxis x:Name="XAxis1"/>
           <chart:NumericalAxis x:Name="XAxis2"/>
       </chart:SfCartesianChart.XAxes>
    
       <chart:SfCartesianChart.YAxes>
          <chart:NumericalAxis />
      </chart:SfCartesianChart.YAxes>
    
             <chart:SplineSeries ItemsSource="{Binding Data}"
                               XBindingPath="XValue"
                               YBindingPath="YValue" 
                               XAxisName="XAxis1" />
             <chart:ColumnSeries ItemsSource = "{Binding Data}"
                           XBindingPath="XValue"
                           YBindingPath="YValue"
                           XAxisName="XAxis2" />
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        var XAxis1 = new CategoryAxis() { Name = "XAXis1" };
        var XAxis2 = new NumericalAxis() { Name = "XAXis2" }; 
        chart.XAxes.Add(XAxis1);
        chart.XAxes.Add(XAxis2);
        var YAxis = new NumericalAxis();
        chart.YAxes.Add(YAxis);
    
        SplineSeries splineSeries = new SplineSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              XAxisName = "XAXis1",
        };
    
        ColumnSeries columnSeries = new ColumnSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              XAxisName = "XAXis2",
        };
    
        chart.Series.Add(splineSeries);
        chart.Series.Add(columnSeries);

    YAxisName

    Gets or sets the name of the (vertical) axis in the YAxes collection which is used to plot the series with particular axis.

    Declaration
    public string YAxisName { get; set; }
    Property Value
    Type Description
    System.String

    It takes the string value and its default value is null.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
    
        <chart:SfCartesianChart.XAxes>
           <chart:CategoryAxis />
       </chart:SfCartesianChart.XAxes>
    
       <chart:SfCartesianChart.YAxes>
          <chart:NumericalAxis x:Name="YAxis1"/>
          <chart:NumericalAxis x:Name="YAxis2"/>
      </chart:SfCartesianChart.YAxes>
    
             <chart:SplineSeries ItemsSource="{Binding Data}"
                               XBindingPath="XValue"
                               YBindingPath="YValue" 
                               YAxisName="YAxis1" />
             <chart:ColumnSeries ItemsSource = "{Binding Data}"
                           XBindingPath="XValue"
                           YBindingPath="YValue"
                           YAxisName="YAxis2" />
    
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
        ViewModel viewModel = new ViewModel();
    
        var XAxis = new CategoryAxis();
        chart.XAxes.Add(XAxis);
        var YAxis1 = new NumericalAxis(){Name = "YAXis1"};
        var YAxis2 = new NumericalAxis(){Name = "YAXis2"};
        chart.YAxes.Add(YAxis1);
        chart.YAxes.Add(YAxis2);
    
        SplineSeries splineSeries = new SplineSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              YAxisName = "YAXis1",
        };
    
        ColumnSeries columnSeries = new ColumnSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              YAxisName = "YAXis2",
        };
    
        chart.Series.Add(splineSeries);
        chart.Series.Add(columnSeries);

    Methods

    OnBindingContextChanged()

    Declaration
    protected override void OnBindingContextChanged()
    Overrides
    ChartSeries.OnBindingContextChanged()
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved