---
id: "T:cAlgo.API.Polyline"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Polyline/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# Polyline (class)

Draws a series of connected straight lines.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Accepted without error but never displayed, so control events such as Click are never raised.
- Cloud: Accepted without error but never displayed, so control events such as Click are never raised.

## Definition

```csharp
public class Polyline : Shape
```

## Examples

C#:

```csharp
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)
        {
        }
    }
}
```

Python:

```python
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)
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}
```

## Constructors

- `public Polyline()` — Initializes a new instance of the Polyline class. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Polyline/Constructor/index.md)

## Properties

- `public FillRule FillRule {get; set;}` — Gets or sets a FillRule enumeration that specifies how the interior fill of the shape is determined. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Polyline/FillRule/index.md)
- `public Point[] Points {get; set;}` — Gets or sets a collection that contains the vertex points of the Polyline. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Polyline/Points/index.md)

## Inherited members

- `public Color StrokeColor {get; set;}` (from Shape) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeColor/index.md)
- `public Color FillColor {get; set;}` (from Shape) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/FillColor/index.md)
- `public double StrokeThickness {get; set;}` (from Shape) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeThickness/index.md)
- `public Stretch Stretch {get; set;}` (from Shape) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/Stretch/index.md)
- `public PenLineCap StrokeEndLineCap {get; set;}` (from Shape) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeEndLineCap/index.md)
- `public PenLineCap StrokeStartLineCap {get; set;}` (from Shape) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeStartLineCap/index.md)
- `public PenLineJoin StrokeLineJoin {get; set;}` (from Shape) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeLineJoin/index.md)
- `public double StrokeMiterLimit {get; set;}` (from Shape) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeMiterLimit/index.md)
- `public double[] StrokeDashArray {get; set;}` (from Shape) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeDashArray/index.md)
- `public double StrokeDashOffset {get; set;}` (from Shape) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeDashOffset/index.md)
- `public PenLineCap StrokeDashCap {get; set;}` (from Shape) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeDashCap/index.md)
- `public void ResetProperty(ControlProperty property)` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/ResetProperty/index.md)
- `public Guid UniqueId {get;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/UniqueId/index.md)
- `public Style Style {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Style/index.md)
- `public double Left {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Left/index.md)
- `public double Top {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Top/index.md)
- `public double Right {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Right/index.md)
- `public double Bottom {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Bottom/index.md)
- `public double Width {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Width/index.md)
- `public double Height {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Height/index.md)
- `public double MinWidth {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/MinWidth/index.md)
- `public double MinHeight {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/MinHeight/index.md)
- `public double MaxWidth {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/MaxWidth/index.md)
- `public double MaxHeight {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/MaxHeight/index.md)
- `public bool IsEnabled {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/IsEnabled/index.md)
- `public bool IsVisible {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/IsVisible/index.md)
- `public double Opacity {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Opacity/index.md)
- `public Thickness Margin {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Margin/index.md)
- `public VerticalAlignment VerticalAlignment {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/VerticalAlignment/index.md)
- `public HorizontalAlignment HorizontalAlignment {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/HorizontalAlignment/index.md)
- `public Dock Dock {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Dock/index.md)
- `public bool IsHitTestVisible {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/IsHitTestVisible/index.md)

