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

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

# Shape (class)

Provides the base class for shape elements, such as [`Ellipse`](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Ellipse/index.md), [`Polygon`](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Polygon/index.md), and [`Rectangle`](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Rectangle/index.md).

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 abstract class Shape : ControlBase
```

## Examples

C#:

```csharp
var canvas = new Canvas { Width = 300, Height = 120 };
var shapes = new Shape[]
{
    new Rectangle { Width = 80, Height = 40, Left = 10, Top = 10, FillColor = Color.SteelBlue },
    new Ellipse { Width = 40, Height = 40, Left = 110, Top = 10, FillColor = Color.Orange },
    new Line { X1 = 170, Y1 = 30, X2 = 280, Y2 = 30, StrokeColor = Color.White }
};
foreach (var shape in shapes)
{
    shape.StrokeThickness = 2;
    canvas.AddChild(shape);
}
Chart.AddControl(canvas);
```

Python:

```python
canvas = Canvas()
canvas.Width = 300
canvas.Height = 120
rectangle = Rectangle()
rectangle.Width = 80
rectangle.Height = 40
rectangle.FillColor = Color.SteelBlue
ellipse = Ellipse()
ellipse.Width = 40
ellipse.Height = 40
ellipse.Left = 110
ellipse.FillColor = Color.Orange
for shape in [rectangle, ellipse]:
    shape.StrokeThickness = 2
    canvas.AddChild(shape)
api.Chart.AddControl(canvas)
```

## Properties

- `public Color FillColor {get; set;}` — Gets or sets the fill color. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/FillColor/index.md)
- `public Stretch Stretch {get; set;}` — Gets or sets the stretch value. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/Stretch/index.md)
- `public Color StrokeColor {get; set;}` — Gets or sets the stroke color. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeColor/index.md)
- `public double[] StrokeDashArray {get; set;}` — Gets or sets a collection of Double values that indicate the pattern of dashes and gaps that is used to outline shapes. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeDashArray/index.md)
- `public PenLineCap StrokeDashCap {get; set;}` — Gets or sets a PenLineCap enumeration value that specifies how the ends of a dash are drawn. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeDashCap/index.md)
- `public double StrokeDashOffset {get; set;}` — Gets or sets a Double that specifies the distance within the dash pattern where a dash begins. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeDashOffset/index.md)
- `public PenLineCap StrokeEndLineCap {get; set;}` — Gets or sets the shape at the end of a line. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeEndLineCap/index.md)
- `public PenLineJoin StrokeLineJoin {get; set;}` — Gets or sets the shape that joins two lines. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeLineJoin/index.md)
- `public double StrokeMiterLimit {get; set;}` — Gets or sets a limit on the ratio of the miter length to half the StrokeThickness of a Shape element. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeMiterLimit/index.md)
- `public PenLineCap StrokeStartLineCap {get; set;}` — Gets or sets the shape at the beginning of a line. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeStartLineCap/index.md)
- `public double StrokeThickness {get; set;}` — Gets or sets the stroke thickness. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Shape/StrokeThickness/index.md)

## Inherited members

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

