---
id: "P:cAlgo.API.Line.X2"
kind: "property"
type: "T:cAlgo.API.Line"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Line/X2/"
---

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

# Line.X2

Member of [Line](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Shapes/Line/index.md).

## X2

Gets or sets the x-axis point 2 data.

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.

C#:

```csharp
public double X2 {get; set;}
```

Python:

```python
line.X2: float
```

### Returns

`double` — 

### Examples

C#:

```csharp
var line = new Line { X1 = 20, Y1 = 100, X2 = 300, Y2 = 100, StrokeColor = Color.Gray };
line.X2 = Chart.Width / 2;
Chart.AddControl(line);
Print("Line ends at x: {0}", line.X2);
```

Python:

```python
line = Line()
line.X1 = 20
line.Y1 = 100
line.X2 = api.Chart.Width / 2
line.Y2 = 100
line.StrokeColor = Color.Gray
api.Chart.AddControl(line)
api.Print(f"Line ends at x: {line.X2}")
```

