---
id: "T:cAlgo.API.ChartTypeEventArgs"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartTypeEventArgs/"
---

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

# ChartTypeEventArgs (class)

Provides data for the chart type change event.

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

- Cloud: Never raised in the cloud: the events that pass it never fire there (Chart.ChartTypeChanged).

## Definition

```csharp
public class ChartTypeEventArgs
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This example shows how to use the Chart ChartTypeEventArgs
    public partial class ChartTypeEventArgsSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.ChartTypeChanged += Chart_ChartTypeChanged;
        }

        private void Chart_ChartTypeChanged(ChartTypeEventArgs obj)
        {
            var text = string.Format("Chart Type Changed To: {0}", obj.Chart.ChartType);

            Chart.DrawStaticText("type", text, 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 initialize(self):
        api.Chart.ChartTypeChanged += self.on_chart_type_changed

    def on_chart_type_changed(self, args):
        api.Chart.DrawStaticText("type", f"Chart Type Changed To: {args.Chart.ChartType}", VerticalAlignment.Top, HorizontalAlignment.Right, Color.Red)
```

config.json:

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

## Properties

- `public Chart Chart {get;}` — Gets the chart. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartTypeEventArgs/Chart/index.md)

