Skip to content

ChartMouseWheelEventArgs.Delta

property · ChartMouseWheelEventArgs · cAlgo.API

DesktopCLICloud

Gets the number of detents the mouse wheel has rotated. A detent is one notch of the mouse wheel.

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (ChartArea.MouseWheel).

Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (ChartArea.MouseWheel).

Definition

public int Delta {get;}
chartMouseWheelEventArgs.Delta: int

Returns int

Examples

protected override void OnStart()
{
    Chart.MouseWheel += OnChartMouseWheel;
}

private void OnChartMouseWheel(ChartMouseWheelEventArgs args)
{
    var direction = args.Delta > 0 ? "up" : "down";
    Print("Mouse wheel scrolled {0} by {1} detents", direction, Math.Abs(args.Delta));
}
def on_start(self):
    api.Chart.MouseWheel += self.on_chart_mouse_wheel

def on_chart_mouse_wheel(self, args):
    direction = "up" if args.Delta > 0 else "down"
    api.Print(f"Mouse wheel scrolled {direction} by {abs(args.Delta)} detents")