Skip to content

ChartMouseEventArgs.MouseX

property · ChartMouseEventArgs · cAlgo.API

DesktopCLICloud

Gets the X-axis value of the mouse event.

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (ChartArea.MouseDown, ChartArea.MouseEnter, ChartArea.MouseLeave and more).

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

Definition

public double MouseX {get;}
chartMouseEventArgs.MouseX: float

Returns double

Examples

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);
}
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)