---
id: "P:cAlgo.API.ChartMouseEventArgs.MouseX"
kind: "property"
type: "T:cAlgo.API.ChartMouseEventArgs"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartMouseEventArgs/MouseX/"
---

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

# ChartMouseEventArgs.MouseX

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

## MouseX

Gets the X-axis value of the mouse event.

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

- CLI: Never raised in the CLI: the events that pass it never fire there (ChartArea.MouseDown, ChartArea.MouseEnter, ChartArea.MouseLeave and more).
- Cloud: Never raised in the cloud: the events that pass it never fire there (ChartArea.MouseDown, ChartArea.MouseEnter, ChartArea.MouseLeave and more).

C#:

```csharp
public double MouseX {get;}
```

Python:

```python
chartMouseEventArgs.MouseX: float
```

### Returns

`double` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    Chart.MouseMove += OnChartMouseMove;
}

private void OnChartMouseMove(ChartMouseEventArgs args)
{
    Chart.DrawStaticText("mouseX", "Mouse X: " + args.MouseX, VerticalAlignment.Top, HorizontalAlignment.Left, Color.White);
}
```

Python:

```python
def on_start(self):
    api.Chart.MouseMove += self.on_chart_mouse_move

def on_chart_mouse_move(self, args):
    api.Chart.DrawStaticText("mouseX", f"Mouse X: {args.MouseX}", VerticalAlignment.Top, HorizontalAlignment.Left, Color.White)
```

