Rectangle
class cAlgo.API
Represents the rectangle.
Environment behaviour
CLI — not supported. Accepted without error but never displayed, so control events such as Click are never raised.
Cloud — not supported. Accepted without error but never displayed, so control events such as Click are never raised.
Definition
public class Rectangle : Shape
Namespace: cAlgo.API · Group: Shapes · Inherits: Shape, ControlBase
Examples
using cAlgo.API;
namespace cAlgo
{
// This sample shows how to use the Rectangle shape which is a chart control
public partial 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)
{
}
}
}
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)
{
"AccessRights": "None",
"TimeZone": "UTC",
"IsOverlay": true
}
Constructors
Properties
| Name | Description |
|---|---|
RadiusXDesktopCLIClouddouble | Gets or sets the x-axis radius of the ellipse that is used to round the corners of the rectangle. |
RadiusYDesktopCLIClouddouble | Gets or sets the y-axis radius of the ellipse that is used to round the corners of the rectangle. |
Inherited members
From Shape: StrokeColor, FillColor, StrokeThickness, Stretch, StrokeEndLineCap, StrokeStartLineCap, StrokeLineJoin, StrokeMiterLimit, StrokeDashArray, StrokeDashOffset, StrokeDashCap
From ControlBase: ResetProperty, UniqueId, Style, Left, Top, Right, Bottom, Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight, IsEnabled, IsVisible, Opacity, Margin, VerticalAlignment, HorizontalAlignment, Dock, IsHitTestVisible