menu

MAUI Toolkit

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

    Show / Hide Table of Contents

    Class ChartPlotBandLabelStyle

    Represents a LabelStyle class that can be used to customize the plot band labels.

    Inheritance
    System.Object
    ChartLabelStyle
    ChartPlotBandLabelStyle
    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 ChartPlotBandLabelStyle : ChartLabelStyle, ITextElement, IThemeElement
    Remarks

    It provides more options to customize the plot band label.

    HorizontalAlignment - To adjust the alignment for labels, refer to this HorizontalTextAlignment property.

    VerticalAlignment - To adjust the alignment for labels, refer to this VerticalTextAlignment property.

    Angle - To adjust the angle rotation for labels, refer to this Angle property.

    OffsetX - To adjust the padding for labels, refer to this OffsetX property.

    OffsetY - To adjust the padding for labels, refer to this OffsetY property.

    Constructors

    ChartPlotBandLabelStyle()

    Initializes a new instance of the ChartPlotBandLabelStyle.

    Declaration
    public ChartPlotBandLabelStyle()

    Fields

    AngleProperty

    Identifies the Angle bindable property.

    Declaration
    public static readonly BindableProperty AngleProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The identifier for the Angle bindable property determines the rotation angle of the chart plot band labels.

    HorizontalTextAlignmentProperty

    Identifies the HorizontalTextAlignment bindable property.

    Declaration
    public static readonly BindableProperty HorizontalTextAlignmentProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The identifier for the HorizontalTextAlignment bindable property determines the vertical text alignment of the chart plot band labels.

    OffsetXProperty

    Identifies the OffsetX bindable property.

    Declaration
    public static readonly BindableProperty OffsetXProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The identifier for the OffsetX bindable property determines the horizontal offset of the chart plot band labels.

    OffsetYProperty

    Identifies the OffsetY bindable property.

    Declaration
    public static readonly BindableProperty OffsetYProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The identifier for the OffsetY bindable property determines the vertical offset of the chart plot band labels.

    VerticalTextAlignmentProperty

    Identifies the VerticalTextAlignment bindable property.

    Declaration
    public static readonly BindableProperty VerticalTextAlignmentProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The identifier for the VerticalTextAlignment bindable property determines the vertical text alignment of the chart plot band labels.

    Properties

    Angle

    Gets or sets a value that indicates the angle rotation of the plot band label text.

    Declaration
    public double Angle { get; set; }
    Property Value
    Type Description
    System.Double

    It accepts System.Double values and the default value is 0.

    Examples
    • Xaml
    • C#
    <chart:SfCartesianChart>
    
        <chart:SfCartesianChart.XAxes>
            <chart:CategoryAxis>
               <chart:CategoryAxis.PlotBands>
                 <chart:NumericalPlotBandCollection>
                   <chart:NumericalPlotBand Start="1" Size="1">
                    <chart:NumericalPlotBand.LabelStyle>
                     <chart:ChartPlotBandLabelStyle Angle="90"/>
                    </chart:NumericalPlotBand.LabelStyle>
                  </chart:NumericalPlotBandCollection>
               </chart:CategoryAxis.PlotBands>
           </chart:CategoryAxis>
        </chart:SfCartesianChart.XAxes>
    
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    CategoryAxis xaxis = new CategoryAxis();
    NumericalPlotBandCollection bands = new NumericalPlotBandCollection();
    NumericalPlotBand plotBand = new NumericalPlotBand();
    plotBand.Start = 1;
    plotBand.Size = 1;
    ChartPlotBandLabelStyle style = new ChartPlotBandLabelStyle();
    style.Angle = 90;
    plotBand.LabelStyle = style;
    bands.Add(plotBand);
    xaxis.PlotBands = bands;
    
    chart.XAxes.Add(xaxis);

    HorizontalTextAlignment

    Gets or sets the horizontal alignment of the plot band label text.

    Declaration
    public ChartLabelAlignment HorizontalTextAlignment { get; set; }
    Property Value
    Type Description
    ChartLabelAlignment

    This property takes the ChartLabelAlignment as its value. Its default value is Center.

    Examples
    • Xaml
    • C#
    <chart:SfCartesianChart>
    
        <chart:SfCartesianChart.XAxes>
            <chart:CategoryAxis>
               <chart:CategoryAxis.PlotBands>
                 <chart:NumericalPlotBandCollection>
                   <chart:NumericalPlotBand Start="1" Size="1">
                    <chart:NumericalPlotBand.LabelStyle>
                     <chart:ChartPlotBandLabelStyle HorizontalTextAlignment="Start"/>
                    </chart:NumericalPlotBand.LabelStyle>
                  </chart:NumericalPlotBandCollection>
               </chart:CategoryAxis.PlotBands>
           </chart:CategoryAxis>
        </chart:SfCartesianChart.XAxes>
    
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    CategoryAxis xaxis = new CategoryAxis();
    NumericalPlotBandCollection bands = new NumericalPlotBandCollection();
    NumericalPlotBand plotBand = new NumericalPlotBand();
    plotBand.Start = 1;
    plotBand.Size = 1;
    ChartPlotBandLabelStyle style = new ChartPlotBandLabelStyle();
    style.HorizontalTextAlignment = ChartLabelAlignment.Start;
    plotBand.LabelStyle = style;
    bands.Add(plotBand);
    xaxis.PlotBands = bands;
    
    chart.XAxes.Add(xaxis);

    OffsetX

    Gets or sets a value to provide horizontal padding to the plot band label text.

    Declaration
    public double OffsetX { get; set; }
    Property Value
    Type Description
    System.Double

    It accepts System.Double values and the default value is 0.

    Examples
    • Xaml
    • C#
    <chart:SfCartesianChart>
    
        <chart:SfCartesianChart.XAxes>
            <chart:CategoryAxis>
               <chart:CategoryAxis.PlotBands>
                <chart:NumericalPlotBandCollection>
                   <chart:NumericalPlotBand Start="1" Width="1">
                    <chart:NumericalPlotBand.LabelStyle>
                     <chart:ChartPlotBandLabelStyle OffsetX="5"/>
                    </chart:NumericalPlotBand.LabelStyle>
                 </chart:NumericalPlotBandCollection>
               </chart:CategoryAxis.PlotBands>
           </chart:CategoryAxis>
        </chart:SfCartesianChart.XAxes>
    
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    CategoryAxis xaxis = new CategoryAxis();
    NumericalPlotBandCollection bands = new NumericalPlotBandCollection();
    NumericalPlotBand plotBand = new NumericalPlotBand();
    plotBand.Start = 1;
    plotBand.Width = 1;
    ChartPlotBandLabelStyle style = new ChartPlotBandLabelStyle();
    style.OffsetX = 5;
    plotBand.LabelStyle = style;
    bands.Add(plotBand);
    xaxis.PlotBands = bands;
    
    chart.XAxes.Add(xaxis);

    OffsetY

    Gets or sets a value to provide vertical padding to the plot band label text.

    Declaration
    public double OffsetY { get; set; }
    Property Value
    Type Description
    System.Double

    It accepts System.Double values and the default value is 0.

    Examples
    • Xaml
    • C#
    <chart:SfCartesianChart>
    
        <chart:SfCartesianChart.XAxes>
            <chart:CategoryAxis>
               <chart:CategoryAxis.PlotBands>
                <chart:NumericalPlotBandCollection>
                   <chart:NumericalPlotBand Start="1" Size="1">
                    <chart:NumericalPlotBand.LabelStyle>
                     <chart:ChartPlotBandLabelStyle OffsetY="10"/>
                    </chart:NumericalPlotBand.LabelStyle>
                 </chart:NumericalPlotBandCollection>
               </chart:CategoryAxis.PlotBands>
           </chart:CategoryAxis>
        </chart:SfCartesianChart.XAxes>
    
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    CategoryAxis xaxis = new CategoryAxis();
    NumericalPlotBandCollection bands = new NumericalPlotBandCollection();
    NumericalPlotBand plotBand = new NumericalPlotBand();
    plotBand.Start = 1;
    plotBand.Size = 1;
    ChartPlotBandLabelStyle style = new ChartPlotBandLabelStyle();
    style.OffsetY = 10;
    plotBand.LabelStyle = style;
    bands.Add(plotBand);
    xaxis.PlotBands = bands;
    
    chart.XAxes.Add(xaxis);

    VerticalTextAlignment

    Gets or sets the vertical alignment of the plot band label text.

    Declaration
    public ChartLabelAlignment VerticalTextAlignment { get; set; }
    Property Value
    Type Description
    ChartLabelAlignment

    This property takes the ChartLabelAlignment as its value. Its default value is Center.

    Examples
    • Xaml
    • C#
    <chart:SfCartesianChart>
    
        <chart:SfCartesianChart.XAxes>
            <chart:CategoryAxis>
               <chart:CategoryAxis.PlotBands>
                 <chart:NumericalPlotBandCollection>
                   <chart:NumericalPlotBand Start="1" Size="1">
                    <chart:NumericalPlotBand.LabelStyle>
                     <chart:ChartPlotBandLabelStyle VerticalTextAlignment="End"/>
                    </chart:NumericalPlotBand.LabelStyle>
                  </chart:NumericalPlotBandCollection>
               </chart:CategoryAxis.PlotBands>
           </chart:CategoryAxis>
        </chart:SfCartesianChart.XAxes>
    
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    CategoryAxis xaxis = new CategoryAxis();
    NumericalPlotBandCollection bands = new NumericalPlotBandCollection();
    NumericalPlotBand plotBand = new NumericalPlotBand();
    plotBand.Start = 1;
    plotBand.Size = 1;
    ChartPlotBandLabelStyle style = new ChartPlotBandLabelStyle();
    style.VerticalTextAlignment = ChartLabelAlignment.End;
    plotBand.LabelStyle = style;
    bands.Add(plotBand);
    xaxis.PlotBands = bands;
    
    chart.XAxes.Add(xaxis);
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved