Skip to content

ChartMouseEventArgs.ChartArea

property · ChartMouseEventArgs · cAlgo.API

DesktopCLICloud

Gets the chart area.

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 ChartArea ChartArea {get;}
chartMouseEventArgs.ChartArea: ChartArea

Returns ChartArea

Examples

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

private void OnChartMouseDown(ChartMouseEventArgs args)
{
    var areaName = args.ChartArea == args.Chart ? "main area" : "indicator area";
    Print("Clicked on the {0}, area height: {1}", areaName, args.ChartArea.Height);
}
def on_start(self):
    api.Chart.MouseDown += self.on_chart_mouse_down

def on_chart_mouse_down(self, args):
    api.Print(f"Clicked on an area with height: {args.ChartArea.Height}, top Y: {args.ChartArea.TopY}, bottom Y: {args.ChartArea.BottomY}")