Getting the Y value from a horizontal line.
Created at 21 May 2021, 00:11
Getting the Y value from a horizontal line.
21 May 2021, 00:11
I am unable to get the Y value of an existing horizontal line. Drawing the line and immediately finding out the Y value is no problem. I want to be able to move a horizontal line and read the new value. I've tried with
Chart.ObjectHoverChanged + = OnChartObjectHoverChanged;
Chart.DragEnd + = OnDragEnd;
Chart.DragStart + = OnChartDragStart;
Chart.ObjectsSelectionChanged + = OnChartObjectsSelectionChanged;
I can get the name, comment, etc., but no Y value. A small example is sufficient.
hslagter
21 May 2021, 18:59
RE: I found it and I won't keep it for myself ;-).
hslagter said:
ChartHorizontalLine LowerLine;
ChartHorizontalLine templine;
protected override void OnStart()
{
LowerLine = Chart.DrawHorizontalLine("lowerline", Symbol.Bid, Color.Yellow, AlertLineThick, AlertLineStyle);
LowerLine.IsInteractive = true;
}
protected override void OnTick()
{
templine = LowerLine;
Chart.DrawStaticText("test", templine.Y.ToString("0.00000"), VerticalAlignment.Center, HorizontalAlignment.Center, Color.White);
}
@hslagter