menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DateTimePlotBand - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DateTimePlotBand

    The DateTimePlotBand class can render the plot band using the DateTime values.

    Inheritance
    System.Object
    ChartPlotBand
    DateTimePlotBand
    Inherited Members
    ChartPlotBand.AssociatedAxisEnd
    ChartPlotBand.AssociatedAxisEndProperty
    ChartPlotBand.AssociatedAxisName
    ChartPlotBand.AssociatedAxisNameProperty
    ChartPlotBand.AssociatedAxisStart
    ChartPlotBand.AssociatedAxisStartProperty
    ChartPlotBand.Fill
    ChartPlotBand.FillProperty
    ChartPlotBand.IsRepeatable
    ChartPlotBand.IsRepeatableProperty
    ChartPlotBand.IsVisible
    ChartPlotBand.IsVisibleProperty
    ChartPlotBand.LabelStyle
    ChartPlotBand.LabelStyleProperty
    ChartPlotBand.OnBindingContextChanged()
    ChartPlotBand.OnParentSet()
    ChartPlotBand.RepeatEvery
    ChartPlotBand.RepeatEveryProperty
    ChartPlotBand.Size
    ChartPlotBand.SizeProperty
    ChartPlotBand.Stroke
    ChartPlotBand.StrokeDashArray
    ChartPlotBand.StrokeDashArrayProperty
    ChartPlotBand.StrokeProperty
    ChartPlotBand.StrokeWidth
    ChartPlotBand.StrokeWidthProperty
    ChartPlotBand.Text
    ChartPlotBand.TextProperty
    Namespace: Syncfusion.Maui.Charts
    Assembly: Syncfusion.Maui.Charts.dll
    Syntax
    public class DateTimePlotBand : ChartPlotBand
    Remarks

    DateTimePlotBand requires Start and End properties to be set to render the Plot band.

    Examples
    • MainWindow.xaml
    • MainWindow.cs
    <chart:SfCartesianChart>
    
        <chart:SfCartesianChart.XAxes>
            <chart:DateTimeAxis>
               <chart:DateTimeAxis.PlotBands>
                 <chart:DateTimePlotBandCollection>
                   <chart:DateTimePlotBand Start="2000-01-01" Size="2" SizeType="Month"/>
                 </chart:DateTimePlotBandCollection>
               </chart:DateTimeAxis.PlotBands>
           </chart:DateTimeAxis>
        </chart:SfCartesianChart.XAxes>
    
    </chart:SfCartesianChart>
    SfCartesianChart chart = new SfCartesianChart();
    
    DateTimeAxis xAxis = new DateTimeAxis();
    DateTimePlotBandCollection bands = new DateTimePlotBandCollection();
    DateTimePlotBand plotBand = new DateTimePlotBand();
    plotBand.Start = new DateTime(2000,01,01);
    plotBand.Size = 2;
    plotBand.SizeType = DateTimeIntervalType.Months;
    bands.Add(plotBand);
    xAxis.PlotBands = bands;
    
    chart.XAxes.Add(xAxis);

    Constructors

    DateTimePlotBand()

    Declaration
    public DateTimePlotBand()

    Fields

    EndProperty

    Identifies the End bindable property.

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

    RepeatEveryTypeProperty

    Identifies the RepeatEveryType bindable property.

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

    RepeatUntilProperty

    Identifies the RepeatUntil bindable property.

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

    SizeTypeProperty

    Identifies the SizeType bindable property.

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

    StartProperty

    Identifies the Start bindable property.

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

    Properties

    End

    Gets or sets the axis value representing where the plot band should end on the axis.

    Declaration
    public Nullable<DateTime> End { get; set; }
    Property Value
    Type Description
    System.Nullable<System.DateTime>

    This property takes System.DateTime as its value.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
           <chart:SfCartesianChart.XAxes>
              <chart:DateTimeAxis>
                 <chart:DateTimeAxis.PlotBands>
                    <chart:DateTimePlotBandCollection>
                        <chart:DateTimePlotBand Start="2000-01-01" End="2000-02-02"/>
                    <chart:DateTimePlotBandCollection>
                 </chart:DateTimeAxis.PlotBands>
                </chart:DateTimeAxis>
            </chart:SfCartesianChart.XAxes>
        <!-- ... Eliminated for simplicity-->             
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
    
        DateTimeAxis xAxis = new DateTimeAxis();
        DateTimePlotBandCollection bands = new DateTimePlotBandCollection(); 
        DateTimePlotBand plotBand = new DateTimePlotBand();
        plotBand.Start = new DateTime(2000,01,01);
        plotBand.End = new DateTime(2000,02,02);
        bands.Add(plotBand);
        xAxis.PlotBands = bands;
    
        chart.XAxes.Add(xAxis);

    RepeatEveryType

    Gets or sets the date time unit of the value specified in the RepeatEvery property.

    Declaration
    public DateTimeIntervalType RepeatEveryType { get; set; }
    Property Value
    Type Description
    DateTimeIntervalType

    This property takes the DateTimeIntervalType value.

    Remarks

    If RepeatEveryType is auto, it will take the default interval from the dateTime axis.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
           <chart:SfCartesianChart.XAxes>
              <chart:DateTimeAxis>
                 <chart:DateTimeAxis.PlotBands>
                    <chart:DateTimePlotBandCollection>
                        <chart:DateTimePlotBand Start="2000-01-01" End="2000-02-02" SizeType="Months" RepeatEveryType="Days"/>
                     </chart:DateTimePlotBandCollection>
                 </chart:DateTimeAxis.PlotBands>
                </chart:DateTimeAxis>
            </chart:SfCartesianChart.XAxes>
        <!-- ... Eliminated for simplicity-->             
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
    
        DateTimeAxis xAxis = new DateTimeAxis();
        DateTimePlotBandCollection bands = new DateTimePlotBandCollection();  
        DateTimePlotBand plotBand = new DateTimePlotBand();
        plotBand.Start = new DateTime(2000,01,01);
        plotBand.End = new DateTime(2000,02,02);
        plotBand.SizeType = DateTimeIntervalType.Months;
        plotBand.RepeatEveryType = DateTimeIntervalType.Days;
    
        bands.Add(plotBand);
        xAxis.PlotBands = bands;
    
        chart.XAxes.Add(xAxis);

    RepeatUntil

    Gets or sets the axis value, determining where the plot band must be repeated on the axis.

    Declaration
    public Nullable<DateTime> RepeatUntil { get; set; }
    Property Value
    Type Description
    System.Nullable<System.DateTime>

    This property takes System.DateTime as its value.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
           <chart:SfCartesianChart.XAxes>
              <chart:DateTimeAxis>
                 <chart:DateTimeAxis.PlotBands>
                    <chart:DateTimePlotBandCollection>
                        <chart:DateTimePlotBand Start="2000-01-01" End="2000-02-02" RepeatUntil="2000-03-01"/>
                    <chart:DateTimePlotBandCollection>
                 </chart:DateTimeAxis.PlotBands>
                </chart:DateTimeAxis>
            </chart:SfCartesianChart.XAxes>
        <!-- ... Eliminated for simplicity-->             
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
    
        DateTimeAxis xAxis = new DateTimeAxis();
        DateTimePlotBandCollection bands = new DateTimePlotBandCollection(); 
        DateTimePlotBand plotBand = new DateTimePlotBand();
        plotBand.Start = new DateTime(2000,01,01);
        plotBand.End =  new DateTime(2000,02,02);
        plotBand.RepeatUntil = new DateTime(2000,03,01);
        bands.Add(plotBand);
        xAxis.PlotBands = bands;
    
        chart.XAxes.Add(xAxis);

    SizeType

    Gets or sets the date time unit of the value specified in the End property.

    Declaration
    public DateTimeIntervalType SizeType { get; set; }
    Property Value
    Type Description
    DateTimeIntervalType

    This property takes the DateTimeIntervalType value.

    Remarks

    If SizeType is auto, it will take the default interval from the dateTime axis.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
           <chart:SfCartesianChart.XAxes>
              <chart:DateTimeAxis>
                 <chart:DateTimeAxis.PlotBands>
                     <chart:DateTimePlotBandCollection>
                        <chart:DateTimePlotBand Start="2000-01-01" End="2000-02-02" SizeType="Months"/>
                      </chart:DateTimePlotBandCollection>
                 </chart:DateTimeAxis.PlotBands>
                </chart:DateTimeAxis>
            </chart:SfCartesianChart.XAxes>
        <!-- ... Eliminated for simplicity-->             
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
    
        DateTimeAxis xAxis = new DateTimeAxis();
        DateTimePlotBandCollection bands = new DateTimePlotBandCollection();  
        DateTimePlotBand plotBand = new DateTimePlotBand();
        plotBand.Start = new DateTime(2000,01,01);
        plotBand.End =  new DateTime(2000,02,02);
        plotBand.SizeType = DateTimeIntervalType.Months;
        bands.Add(plotBand);
        xAxis.PlotBands = bands;
    
        chart.XAxes.Add(xAxis);

    Start

    Gets or sets the axis value representing where the plot band should start on the axis.

    Declaration
    public Nullable<DateTime> Start { get; set; }
    Property Value
    Type Description
    System.Nullable<System.DateTime>

    This property takes System.DateTime as its value.

    Examples
    • Xaml
    • C#
        <chart:SfCartesianChart>
           <chart:SfCartesianChart.XAxes>
              <chart:DateTimeAxis>
                 <chart:DateTimeAxis.PlotBands>
                    <chart:DateTimePlotBandCollection>
                      <chart:DateTimePlotBand Start="2000-01-01" Size="2"/>
                    </chart:DateTimePlotBandCollection>
                 </chart:DateTimeAxis.PlotBands>
                </chart:DateTimeAxis>
            </chart:SfCartesianChart.XAxes>
        <!-- ... Eliminated for simplicity-->             
        </chart:SfCartesianChart>
        SfCartesianChart chart = new SfCartesianChart();
    
        DateTimeAxis xAxis = new DateTimeAxis();
        DateTimePlotBandCollection bands = new DateTimePlotBandCollection();  
        DateTimePlotBand plotBand = new DateTimePlotBand();
        plotBand.Start = new DateTime(2000,01,01);
        plotBand.Size = 2;
        bands.Add(plotBand);
        xAxis.PlotBands = bands;
    
        chart.XAxes.Add(xAxis);
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved