ChartMouseEventArgs.TimeValue
property · ChartMouseEventArgs · cAlgo.API
DesktopCLICloud
Gets the time value on the X-axis where the mouse event occurs.
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 DateTime TimeValue {get;}
chartMouseEventArgs.TimeValue: DateTime
Returns DateTime
Examples
protected override void OnStart()
{
Chart.MouseDown += OnChartMouseDown;
}
private void OnChartMouseDown(ChartMouseEventArgs args)
{
Chart.DrawVerticalLine("clickedTime", args.TimeValue, Color.Red);
Print("Clicked at time {0}", args.TimeValue);
}
def on_start(self):
api.Chart.MouseDown += self.on_chart_mouse_down
def on_chart_mouse_down(self, args):
api.Chart.DrawVerticalLine("clickedTime", args.TimeValue, Color.Red)
api.Print(f"Clicked at time {args.TimeValue}")