Class CartesianSeries
CartesianSeries is the base class for all cartesian charts such as column, line, area, and so on.
Inheritance
Inherited Members
Namespace: Syncfusion.Maui.Charts
Assembly: Syncfusion.Maui.Charts.dll
Syntax
public abstract class CartesianSeries : ChartSeries, IDatapointSelectionDependent, ITooltipDependent, IDataTemplateDependent
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 |
---|
Microsoft.Maui.Controls.BindableProperty |
LabelProperty
Identifies the Label bindable property.
Declaration
public static readonly BindableProperty LabelProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ShowTrackballLabelProperty
Identifies the ShowTrackballLabel bindable property.
Declaration
public static readonly BindableProperty ShowTrackballLabelProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
TrackballLabelTemplateProperty
Identifies the TrackballLabelTemplate bindable property.
Declaration
public static readonly BindableProperty TrackballLabelTemplateProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
XAxisNameProperty
Identifies the XAxisName bindable property.
Declaration
public static readonly BindableProperty XAxisNameProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
YAxisNameProperty
Identifies the YAxisName bindable property.
Declaration
public static readonly BindableProperty YAxisNameProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Properties
ActualXAxis
Gets the actual XAxis value.
Declaration
public ChartAxis ActualXAxis { get; }
Property Value
Type |
---|
ChartAxis |
ActualYAxis
Gets the actual YAxis value.
Declaration
public ChartAxis ActualYAxis { get; }
Property Value
Type |
---|
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
<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>
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
<chart:SfCartesianChart>
<!-- ... Eliminated for simplicity-->
<chart:ColumnSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
Label = "ColumnSeries"/>
</chart:SfCartesianChart>
ShowTrackballLabel
Gets or sets whether to show trackball label on the corresponding series
Declaration
public bool ShowTrackballLabel { get; set; }
Property Value
Type |
---|
System.Boolean |
TrackballLabelTemplate
Gets or sets the DataTemplate to customize the appearance of the corresponding series Trackball labels.
Declaration
public DataTemplate TrackballLabelTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.DataTemplate | It accepts the Microsoft.Maui.Controls.DataTemplatevalue and its default value is null. |
Examples
<chart:SfCartesianChart>
<chart:SfCartesianChart.TrackballBehavior>
<chart:ChartTrackballBehavior />
</chart:SfCartesianChart.TrackballBehavior>
<chart:SfCartesianChart.Resources>
<DataTemplate x:Key="TrackballTemplate">
<HorizontalStackLayout>
<Image Source="image.png"
WidthRequest="20"
HeightRequest="20"/>
<Label Text="{Binding Label}"
TextColor="Black"
FontAttributes="Bold"
FontSize="12"/>
</HorizontalStackLayout>
</DataTemplate>
</chart:SfCartesianChart.Resources>
<chart:SfCartesianChart.XAxes>
<chart:NumericalAxis/>
</chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes>
<chart:NumericalAxis/>
</chart:SfCartesianChart.YAxes>
<chart:SfCartesianChart.Series>
<chart:LineSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowTrackballLabel = "True"
TrackballLabelTemplate="{StaticResource TrackballTemplate}">
</chart:LineSeries>
</chart:SfCartesianChart.Series>
</chart:SfCartesianChart>
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
<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>
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
<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>
Methods
GetDataPoints(Rect)
Declaration
public List<object> GetDataPoints(Rect rectangle)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Maui.Graphics.Rect | rectangle |
Returns
Type |
---|
System.Collections.Generic.List<System.Object> |
GetDataPoints(Double, Double, Double, Double)
Declaration
public List<object> GetDataPoints(double startX, double endX, double startY, double endY)
Parameters
Type | Name | Description |
---|---|---|
System.Double | startX | |
System.Double | endX | |
System.Double | startY | |
System.Double | endY |
Returns
Type |
---|
System.Collections.Generic.List<System.Object> |
OnBindingContextChanged()
Declaration
protected override void OnBindingContextChanged()