---
id: "T:cAlgo.API.ChartType"
kind: "enum"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/ChartType/"
---

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

# ChartType (enum)

Represents the predefined chart types.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public enum ChartType
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This example shows how to use the Chart ChartIconType
    public partial class ChartTypeSample : Indicator
    {
        protected override void Initialize()
        {
            ShowChartType();

            Chart.ChartTypeChanged += Chart_ChartTypeChanged;
        }

        private void Chart_ChartTypeChanged(ChartTypeEventArgs obj)
        {
            ShowChartType();
        }

        private void ShowChartType()
        {
            Chart.DrawStaticText("type", string.Format("Type: {0}", Chart.ChartType), VerticalAlignment.Top, HorizontalAlignment.Right, Color.Red);
        }

        public override void Calculate(int index)
        {
        }
    }
}
```

Python:

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

from cAlgo.API import *

class Test():
    def show_chart_type(self):
        api.Chart.DrawStaticText("type", f"Type: {api.Chart.ChartType}", VerticalAlignment.Top, HorizontalAlignment.Right, Color.Red)

    def initialize(self):
        self.show_chart_type()

        api.Chart.ChartTypeChanged += lambda _: self.show_chart_type()
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}
```

## Values

- `ChartType.Bars` — The Bar chart.
- `ChartType.Candlesticks` — The Candlestick chart.
- `ChartType.Line` — The Line chart.
- `ChartType.Dots` — The Dots chart.
- `ChartType.Area` — The Area chart.
- `ChartType.Hlc` — The HLC chart.

