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

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

# ChartArea.ScrollChanged

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

## ScrollChanged

Occurs when the X-axis position value or the Y-axis position value changes while scrolling.

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

- CLI: Only the cBot's own scrolling can raise it; no user can scroll a chart in the CLI.
- Cloud: Never raised: the cloud host does not report viewport changes.

C#:

```csharp
event Action<ChartScrollEventArgs> ScrollChanged;
```

Python:

```python
chartArea.ScrollChanged += handler  # handler(obj: ChartScrollEventArgs)
```

### Returns

`Action<ChartScrollEventArgs>` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    Chart.ScrollChanged += OnChartScrollChanged;
}

private void OnChartScrollChanged(ChartScrollEventArgs args)
{
    Print("Scrolled by {0} bars | Top Y delta: {1}", args.BarsDelta, args.TopYDelta);
}
```

Python:

```python
def on_start(self):
    api.Chart.ScrollChanged += self.on_chart_scroll_changed

def on_chart_scroll_changed(self, args):
    api.Print(f"Scrolled by {args.BarsDelta} bars | Top Y delta: {args.TopYDelta}")
```

