Skip to content

ChartArea.MouseDown

event · ChartArea · cAlgo.API

DesktopCLICloud

Occurs when the left mouse button is pressed down.

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> MouseDown;
chartArea.MouseDown += handler  # handler(obj: ChartMouseEventArgs)

Examples

protected override void OnStart()
{
    Chart.MouseDown += OnChartMouseDown;
}

private void OnChartMouseDown(ChartMouseEventArgs args)
{
    if (args.CtrlKey)
        Chart.DrawHorizontalLine("clickLevel", args.YValue, Color.Yellow);
}
def on_start(self):
    api.Chart.MouseDown += self.on_chart_mouse_down

def on_chart_mouse_down(self, args):
    if args.CtrlKey:
        api.Chart.DrawHorizontalLine("clickLevel", args.YValue, Color.Yellow)