Skip to content

Polygon

class cAlgo.API

DesktopCLICloud

Draws a polygon, which is a connected series of lines that form a closed shape.

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 Polygon : Shape

Namespace: cAlgo.API · Group: Shapes · Inherits: Shape, ControlBase

Examples

using cAlgo.API;

namespace cAlgo
{
    // This sample shows how to draw a Polygon
    public partial class PolygonSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.AddControl(new Polygon
            {
                FillColor = Color.Red,
                Width = 200,
                Height = 100,
                Margin = 10,
                Points = new Point[]
                {
                    new Point(100, 100),
                    new Point(200, 50),
                    new Point(300, 100),
                    new Point(100, 100),
                }
            });
        }

        public override void Calculate(int index)
        {
        }
    }
}
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def initialize(self):
        polygon = Polygon()
        polygon.FillColor = Color.Red
        polygon.Width = 200
        polygon.Height = 100
        polygon.Margin = Thickness(10)
        polygon.Points = [Point(100, 100), Point(200, 50), Point(300, 100), Point(100, 100)]

        api.Chart.AddControl(polygon)
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}

Constructors

Name Description
PolygonDesktopCLICloud Initializes a new instance of the Polygon class.

Properties

Name Description
FillRuleDesktopCLICloudFillRule Gets or sets a FillRule enumeration that specifies how the interior fill of the shape is determined.
PointsDesktopCLICloudPoint[] Gets or sets a collection that contains the vertex points of the polygon.

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