---
id: "M:cAlgo.API.ChartTemplate.Apply(cAlgo.API.Chart)"
kind: "method"
type: "T:cAlgo.API.ChartTemplate"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/Templates/ChartTemplate/Apply/"
---

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

# ChartTemplate.Apply

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

## Apply(Chart chart)

Applies current chart template to a chart.

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

- Cloud: Never available in the cloud: it is only returned by members that do not work there (ChartTemplates, ChartTemplates.Create, ChartTemplates.DefaultTemplate and more).

C#:

```csharp
void Apply(Chart chart)
```

Python:

```python
chartTemplate.Apply(chart: Chart) -> None
```

### Parameters

- `chart` (`Chart`, Python `Chart`): Chart that will be current template applied to.

Available since cAlgo.API 5.6.

### Examples

C#:

```csharp
var template = ChartTemplates.Get("My Template");
if (template != null)
{
    template.Apply(Chart);
    Print("Applied template {0}", template.Name);
}
```

Python:

```python
template = api.ChartTemplates.Get("My Template")
if template is not None:
    template.Apply(api.Chart)
    api.Print(f"Applied template {template.Name}")
```

