Skip to content

Polyline

class cAlgo.API

DesktopCLICloud

Draws a series of connected straight lines.

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

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

Examples

using cAlgo.API;

namespace cAlgo
{
    // This sample shows how to use Polyline to draw connected lines
    public partial class PolylineSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.AddControl(new Polyline
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
                StrokeColor = Color.Red,
                StrokeThickness = 1,
                Points = new[]
                {
                    new Point(10, 10),
                    new Point(100,200),
                    new Point(10, 100),
                    new Point(10, 10),
                }
            });
        }

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

from cAlgo.API import *

class Test():
    def initialize(self):
        polyline = Polyline()
        polyline.HorizontalAlignment = HorizontalAlignment.Center
        polyline.VerticalAlignment = VerticalAlignment.Center
        polyline.StrokeColor = Color.Red
        polyline.StrokeThickness = 1
        polyline.Points = [Point(10, 10), Point(100,200), Point(10, 100), Point(10, 10)]
        api.Chart.AddControl(polyline)
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}

Constructors

Name Description
PolylineDesktopCLICloud Initializes a new instance of the Polyline 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 Polyline.

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