---
id: "E:cAlgo.API.ChartArea.Drag"
kind: "event"
type: "T:cAlgo.API.ChartArea"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/ChartArea/Drag/"
---

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

# ChartArea.Drag

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

## Drag

Occurs when dragging a chart area.

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

- CLI: Never raised: no chart is displayed, so there is nothing to interact with.
- Cloud: Never raised: no chart is displayed, so there is nothing to interact with.

C#:

```csharp
event Action<ChartDragEventArgs> Drag;
```

Python:

```python
chartArea.Drag += handler  # handler(obj: ChartDragEventArgs)
```

### Returns

`Action<ChartDragEventArgs>` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    Chart.Drag += OnChartDrag;
}

private void OnChartDrag(ChartDragEventArgs args)
{
    Print("Dragging at {0}, {1}", args.MouseX, args.MouseY);
}
```

Python:

```python
def on_start(self):
    api.Chart.Drag += self.on_chart_drag

def on_chart_drag(self, args):
    api.Print(f"Dragging at {args.MouseX}, {args.MouseY}")
```

