private void DrawOrUpdateAcLabel(ChartTriangle leftTriangle, ChartTriangle rightTriangle, ChartTrendLine line, long id, ChartText label = null)
        {
            var labelTime = line.GetLineCenterTime();

            var labelY = line.GetLineCenterY();

            var acLength = rightTriangle.Y2 - leftTriangle.Y2;

            var xaLength = leftTriangle.Y2 - leftTriangle.Y1;

            var ratio = Math.Round(1 + acLength / xaLength, 3);

            if (label == null)
            {
                DrawLabelText(ratio.ToString(), labelTime, labelY, id, objectNameKey: "AC");
            }
            else
            {
                label.Text = ratio.ToString();
                label.Time = labelTime;
                label.Y    = labelY;
            }
        }
Exemple #2
0
        private void DrawOrUpdateSecondConnectionLineLabel(ChartTrendLine fifthLine, ChartTrendLine thirdLine, ChartTrendLine secondConnectionLine, long id, ChartText label = null)
        {
            var fifthLineLength = fifthLine.Y2 - fifthLine.Y1;

            var diffLength = thirdLine.Y2 - fifthLine.Y2;

            var ratio = Math.Round(diffLength / fifthLineLength, 3);

            var labelTime = secondConnectionLine.GetLineCenterTime();

            var labelY = secondConnectionLine.GetLineCenterY();

            if (label == null)
            {
                DrawLabelText(ratio.ToString(), labelTime, labelY, id, objectNameKey: "SecondConnection");
            }
            else
            {
                label.Text = ratio.ToString();
                label.Time = labelTime;
                label.Y    = labelY;
            }
        }