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

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

# ChartColorEventArgs (class)

Provides data for the chart color event.

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

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

## Definition

```csharp
public class ChartColorEventArgs
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This example shows how to use the Chart ChartColorEventArgs
    public partial class ChartColorEventArgsSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.ColorsChanged += Chart_ColorsChanged;
        }

        private void Chart_ColorsChanged(ChartColorEventArgs obj)
        {
            Print("Chart {0} {1} Color changed", obj.Chart.SymbolName, obj.Chart.TimeFrame);
        }

        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.ColorsChanged += self.on_chart_color_changed

    def on_chart_color_changed(self, args):
        print(f"Chart {args.Chart.SymbolName} {args.Chart.TimeFrame} Color changed")
```

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/ChartColorEventArgs/Chart/index.md)

