---
id: "P:cAlgo.API.ChartText.HorizontalAlignment"
kind: "property"
type: "T:cAlgo.API.ChartText"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartText/HorizontalAlignment/"
---

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

# ChartText.HorizontalAlignment

Member of [ChartText](https://help.ctrader.com/ctrader-algo/references/Chart/Drawings/ChartText/index.md).

## HorizontalAlignment

Gets or sets the horizontal alignment of the text regarding the anchor point.

Environments: Desktop supported · CLI works differently · Cloud works differently.

- CLI: Created and kept with all its properties, but never drawn: the CLI displays no chart.
- Cloud: Created and kept with all its properties, but never drawn: the cloud displays no chart.

C#:

```csharp
HorizontalAlignment HorizontalAlignment {get; set;}
```

Python:

```python
chartText.HorizontalAlignment: HorizontalAlignment
```

### Returns

`HorizontalAlignment` — 

### Examples

C#:

```csharp
var text = Chart.DrawText("label", "High", Bars.OpenTimes.LastValue, Bars.HighPrices.LastValue, Color.White);
text.HorizontalAlignment = HorizontalAlignment.Center;
Print("Text horizontal alignment: {0}", text.HorizontalAlignment);
```

Python:

```python
text = api.Chart.DrawText("label", "High", api.Bars.OpenTimes.LastValue, api.Bars.HighPrices.LastValue, Color.White)
text.HorizontalAlignment = HorizontalAlignment.Center
api.Print(f"Text horizontal alignment: {text.HorizontalAlignment}")
```

