menu

MAUI Toolkit

  • User Guide
  • Demos
  • Support
Class ChartAxisTitle - MAUI-ToolKit API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChartAxisTitle

    Represents the chart axis's title class.

    Inheritance
    System.Object
    ChartLabelStyle
    ChartAxisTitle
    Inherited Members
    ChartLabelStyle.Background
    ChartLabelStyle.BackgroundProperty
    ChartLabelStyle.CornerRadius
    ChartLabelStyle.CornerRadiusProperty
    ChartLabelStyle.FontAttributes
    ChartLabelStyle.FontAttributesProperty
    ChartLabelStyle.FontFamily
    ChartLabelStyle.FontFamilyProperty
    ChartLabelStyle.FontSize
    ChartLabelStyle.FontSizeProperty
    ChartLabelStyle.LabelFormat
    ChartLabelStyle.LabelFormatProperty
    ChartLabelStyle.Margin
    ChartLabelStyle.MarginProperty
    ChartLabelStyle.Stroke
    ChartLabelStyle.StrokeProperty
    ChartLabelStyle.StrokeWidth
    ChartLabelStyle.StrokeWidthProperty
    ChartLabelStyle.TextColor
    ChartLabelStyle.TextColorProperty
    Namespace: Syncfusion.Maui.Toolkit.Charts
    Assembly: Syncfusion.Maui.Toolkit.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>
    
    &lt;chart:SfCartesianChart.XAxes>
        &lt;chart:CategoryAxis>
           &lt;chart:CategoryAxis.Title>
               &lt;chart:ChartAxisTitle Text=&quot;AxisTitle&quot; 
                                     TextColor=&quot;Red&quot;
                                     Background=&quot;Yellow/>
           &lt;/chart:CategoryAxis.Title>
       &lt;/chart:CategoryAxis>
    &lt;/chart:SfCartesianChart.XAxes>
    

    </chart:SfCartesianChart>

    • MainPage.xaml.cs
    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.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved