Skip to content

Rectangle

Summary

Represents the rectangle.

Signature

1
public class Rectangle : Shape

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to use the Rectangle shape which is a chart control
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class RectangleShapeSample : Indicator
     {
         protected override void Initialize()
         {
             var stackPanel = new StackPanel
             {
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
                 BackgroundColor = Color.Gold,
                 Opacity = 0.6
             };
             var rectangle = new Rectangle
             {
                 StrokeColor = Color.Blue,
                 FillColor = Color.Red,
                 StrokeThickness = 2,
                 Margin = 10,
                 Width = 300,
                 Height = 100
             };
             stackPanel.AddChild(rectangle);
             Chart.AddControl(stackPanel);
         }
         public override void Calculate(int index)
         {
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 import clr
 clr.AddReference("cAlgo.API")
 from cAlgo.API import *
 class Test():    
     def initialize(self):
         stackPanel = StackPanel()
         stackPanel.HorizontalAlignment = HorizontalAlignment.Center
         stackPanel.VerticalAlignment = VerticalAlignment.Center
         stackPanel.BackgroundColor = Color.Gold
         stackPanel.Opacity = 0.6
         rectangle = Rectangle()
         rectangle.StrokeColor = Color.Blue
         rectangle.FillColor = Color.Red
         rectangle.StrokeThickness = 2
         rectangle.Margin = Thickness(10)
         rectangle.Width = 300
         rectangle.Height = 100
         stackPanel.AddChild(rectangle)
         api.Chart.AddControl(stackPanel)

Properties

RadiusX

Summary

Gets or sets the x-axis radius of the ellipse that is used to round the corners of the rectangle.

Signature

1
public double RadiusX {get; set;}

Return Value

double

RadiusY

Summary

Gets or sets the y-axis radius of the ellipse that is used to round the corners of the rectangle.

Signature

1
public double RadiusY {get; set;}

Return Value

double