---
id: "T:cAlgo.API.ChartContainers"
kind: "interface"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Chart/ChartContainers/"
---

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

# ChartContainers (interface)

Represents the list of all the chart containers.

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

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

## Definition

```csharp
public interface ChartContainers
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo.Plugins;

public partial class Test : Plugin
{
    protected override void OnStart()
    {
        Print($"Current chart containers #: {ChartManager.ChartContainers.Count}");
        Print($"Main Chart Container is: {ChartManager.ChartContainers.MainChartContainer}, number of frames: {ChartManager.ChartContainers.MainChartContainer.Count}");

        foreach (var chartContainer in ChartManager.ChartContainers)
        {
            Print($"Chart container Id: {chartContainer.Id}, Frames #: {chartContainer.Count}, Is Main: {chartContainer == ChartManager.ChartContainers.MainChartContainer}");
        }
    }
}
```

Python:

```python
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def on_start(self):
        print(f"Current chart containers #: {api.ChartManager.ChartContainers.Count}")
        print(f"Main Chart Container is: {api.ChartManager.ChartContainers.MainChartContainer}, number of frames: {api.ChartManager.ChartContainers.MainChartContainer.Count}")

        for chartContainer in api.ChartManager.ChartContainers:
            print(f"Chart container Id: {chartContainer.Id}, Frames #: {chartContainer.Count}, Is Main: {chartContainer == api.ChartManager.ChartContainers.MainChartContainer}")
```

config.json:

```json
{
  "AccessRights": "None"
}
```

## Methods

- `ChartContainer Get(string id)` — Returns a chart container by it is ID. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Chart/ChartContainers/Get/index.md)

## Properties

- `int Count {get;}` — Returns number of all chart containers. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Chart/ChartContainers/Count/index.md)
- `ChartContainer MainChartContainer {get;}` — Returns main chart container. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Chart/ChartContainers/MainChartContainer/index.md)

## Events

- `event Action<ChartContainersAddedEventArgs> ContainersAdded;` — Occurs when new containers are added. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Chart/ChartContainers/ContainersAdded/index.md)
- `event Action<ChartContainersRemovedEventArgs> ContainersRemoved;` — Occurs when containers are removed. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Chart/ChartContainers/ContainersRemoved/index.md)

