menu

MAUI Toolkit

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

    Show / Hide Table of Contents

    Class RectangleAnnotation

    This class is used to add a rectangle annotation in SfCartesianChart. An instance of this class need to be added to Annotations collection.

    Inheritance
    System.Object
    ChartAnnotation
    ShapeAnnotation
    RectangleAnnotation
    Inherited Members
    ChartAnnotation.CoordinateUnit
    ChartAnnotation.CoordinateUnitProperty
    ChartAnnotation.IsVisible
    ChartAnnotation.IsVisibleProperty
    ChartAnnotation.X1
    ChartAnnotation.X1Property
    ChartAnnotation.XAxisName
    ChartAnnotation.XAxisNameProperty
    ChartAnnotation.Y1
    ChartAnnotation.Y1Property
    ChartAnnotation.YAxisName
    ChartAnnotation.YAxisNameProperty
    ShapeAnnotation.Fill
    ShapeAnnotation.FillProperty
    ShapeAnnotation.LabelStyle
    ShapeAnnotation.LabelStyleProperty
    ShapeAnnotation.Stroke
    ShapeAnnotation.StrokeDashArray
    ShapeAnnotation.StrokeDashArrayProperty
    ShapeAnnotation.StrokeProperty
    ShapeAnnotation.StrokeWidth
    ShapeAnnotation.StrokeWidthProperty
    ShapeAnnotation.Text
    ShapeAnnotation.TextProperty
    ShapeAnnotation.X2
    ShapeAnnotation.X2Property
    ShapeAnnotation.Y2
    ShapeAnnotation.Y2Property
    Namespace: Syncfusion.Maui.Toolkit.Charts
    Assembly: Syncfusion.Maui.Toolkit.dll
    Syntax
    public class RectangleAnnotation : ShapeAnnotation, IThemeElement
    Remarks

    RectangleAnnotation is used to draw a rectangle over the chart area.

    Examples
    • MainPage.xaml
    • MainPage.xaml.cs
    <chart:SfCartesianChart.Annotations>
      <chart:RectangleAnnotation X1="1" Y1="10" X2="4" Y2="20">
      </chart:RectangleAnnotation>
    </chart:SfCartesianChart.Annotations>  
     SfCartesianChart chart = new SfCartesianChart();
     var rectangle = new RectangleAnnotation()
     {
       X1 = 1,
       Y1 = 10,
       X2 = 4,
       Y2 = 20,
     };
    
    chart.Annotations.Add(rectangle);

    Constructors

    RectangleAnnotation()

    Declaration
    public RectangleAnnotation()

    Methods

    Draw(ICanvas, RectF)

    Draws the annotation of the chart.

    Declaration
    protected override void Draw(ICanvas canvas, RectF dirtyRect)
    Parameters
    Type Name Description
    Microsoft.Maui.Graphics.ICanvas canvas
    Microsoft.Maui.Graphics.RectF dirtyRect
    Overrides
    ShapeAnnotation.Draw(ICanvas, RectF)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved