Class ChartAxisTitle
Represents the chart axis's title class.
Inherited Members
Namespace: Syncfusion.Maui.Charts
Assembly: Syncfusion.Maui.Charts.dll
Syntax
public class ChartAxisTitle : ChartLabelStyle, ITextElement, IThemeElement
Remarks
To customize the chart axis's title, add the ChartAxisTitle instance to the Title property as shown in the following code sample.
# [MainPage.xaml](#tab/tabid-1)<chart:SfCartesianChart>
<chart:SfCartesianChart.XAxes>
<chart:CategoryAxis>
<chart:CategoryAxis.Title>
<chart:ChartAxisTitle Text="AxisTitle"
TextColor="Red"
Background="Yellow/>
</chart:CategoryAxis.Title>
</chart:CategoryAxis>
</chart:SfCartesianChart.XAxes>
</chart:SfCartesianChart>
SfCartesianChart chart = new SfCartesianChart();
CategoryAxis xaxis = new CategoryAxis();
xaxis.Title = new ChartAxisTitle()
{
Text = "AxisTitle",
TextColor = Colors.Red,
Background = new SolidColorBrush(Colors.Yellow)
};
chart.XAxes.Add(xaxis);
It provides more options to customize the chart axis title.
Text - To sets the title for axis, refer to this Text property.
TextColor - To customize the text color, refer to this TextColor property.
Background - To customize the background color, refer to this Background property.
Stroke - To customize the stroke color, refer to this Stroke property.
StrokeWidth - To modify the stroke width, refer to this StrokeWidth property.
Constructors
ChartAxisTitle()
Initializes a new instance of the ChartAxisTitle.
Declaration
public ChartAxisTitle()
Fields
TextProperty
Identifies the Text bindable property.
Declaration
public static readonly BindableProperty TextProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Properties
Text
Gets or sets a value that displays the content for the axis title.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String | It accepts string values. |