ChartArea.XToTime
method · ChartArea · cAlgo.API
DesktopCLICloud
Converts Mouse X coordinate to area Time coordinate value.
Environment behaviour
CLI — not supported. Always returns DateTime.MinValue; no conversion is done.
Cloud — not supported. Always returns DateTime.MinValue; no conversion is done.
Definition
DateTime XToTime(double x)
chartArea.XToTime(x: float) -> DateTime
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
x | double | float | Mouse X |
Returns DateTime — Time
Examples
var timeAtCenter = Chart.XToTime(Chart.Width / 2);
Print("Time at the chart center: {0}", timeAtCenter);
timeAtCenter = api.Chart.XToTime(api.Chart.Width / 2)
api.Print(f"Time at the chart center: {timeAtCenter}")