---
id: "M:cAlgo.API.ChartArea.DrawStaticText(System.String,System.String,cAlgo.API.VerticalAlignment,cAlgo.API.HorizontalAlignment,cAlgo.API.Color)"
kind: "method"
type: "T:cAlgo.API.ChartArea"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/ChartArea/DrawStaticText/"
---

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

# ChartArea.DrawStaticText

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

## DrawStaticText(string name, string text, VerticalAlignment verticalAlignment, HorizontalAlignment horizontalAlignment, Color color)

Draws the static text.

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

- CLI: The object is created and returned, but never drawn: the CLI displays no chart.
- Cloud: The object is created and returned, but never drawn: the cloud displays no chart.

C#:

```csharp
ChartStaticText DrawStaticText(string name, string text, VerticalAlignment verticalAlignment, HorizontalAlignment horizontalAlignment, Color color)
```

Python:

```python
chartArea.DrawStaticText(name: str, text: str, verticalAlignment: VerticalAlignment, horizontalAlignment: HorizontalAlignment, color: Color) -> ChartStaticText
```

### Parameters

- `name` (`string`, Python `str`): The chart object name - a unique name that can be only used once for a chart area. If duplicated, the chart object will be replaced with a new one of the same name.
- `text` (`string`, Python `str`): The text content.
- `verticalAlignment` (`VerticalAlignment`, Python `VerticalAlignment`): The vertical alignment.
- `horizontalAlignment` (`HorizontalAlignment`, Python `HorizontalAlignment`): The horizontal alignment.
- `color` (`Color`, Python `Color`): The color of the text.

### Returns

`ChartStaticText` — 

### Examples

C#:

```csharp
var text = Chart.DrawStaticText("info", string.Format("{0} | Spread: {1} pips", SymbolName, Symbol.Spread / Symbol.PipSize), VerticalAlignment.Top, HorizontalAlignment.Right, Color.White);
Print("Static text: {0}", text.Text);
```

Python:

```python
text = api.Chart.DrawStaticText("info", f"{api.SymbolName} | Spread: {api.Symbol.Spread / api.Symbol.PipSize} pips", VerticalAlignment.Top, HorizontalAlignment.Right, Color.White)
api.Print(f"Static text: {text.Text}")
```

