Skip to content

ChartArea.MouseMove

event · ChartArea · cAlgo.API

DesktopCLICloud

Occurs when the cursor moves over the chart area.

Environment behaviour

CLI — not supported. Never raised: no chart is displayed, so there is nothing to interact with.

Cloud — not supported. Never raised: no chart is displayed, so there is nothing to interact with.

Definition

event Action<ChartMouseEventArgs> MouseMove;
chartArea.MouseMove += handler  # handler(obj: ChartMouseEventArgs)

Examples

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

private void OnChartMouseMove(ChartMouseEventArgs args)
{
    Chart.DrawStaticText("cursor", string.Format("{0} | {1}", args.TimeValue, args.YValue), 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("cursor", f"{args.TimeValue} | {args.YValue}", VerticalAlignment.Top, HorizontalAlignment.Left, Color.White)