Example #1
0
        /// <summary>
        /// Рисование значения в точке
        /// </summary>
        /// <param name="dc">контекст рисования</param>
        /// <param name="renderedGraphic"></param>
        protected void DrawValuePoint(DrawingContext dc, GeometryGraphic renderedGraphic)
        {
            int  countPoints          = renderedGraphic.Points.Count;
            bool IsTextUnderPrevPoint = true;

            for (int i = 0; i < countPoints - 1; i++)
            {
                Size cellSize = new Size(renderedGraphic.Points[i].SourcePoint.Value.ToString().Length * 5 + 10, 13);
                IsTextUnderPrevPoint = ToolFunctions.DrawTxtValue(dc, renderedGraphic.Points[i].Position, renderedGraphic.Points[i + 1].Position,
                                                                  renderedGraphic.Points[i].SourcePoint.Value, IsTextUnderPrevPoint, cellSize);
            }
            //Last point
            if (renderedGraphic.Points[countPoints - 1].SourcePoint.Time.CompareTo(CommonData.RightTime) > 0)
            {
                return;
            }
            Size cellSizeLast = new Size(renderedGraphic.Points[countPoints - 1].SourcePoint.Value.ToString().Length * 5 + 10, 13);

            IsTextUnderPrevPoint = ToolFunctions.DrawTxtValue(dc, renderedGraphic.Points[countPoints - 1].Position, renderedGraphic.Points[countPoints - 1].Position,
                                                              renderedGraphic.Points[countPoints - 1].SourcePoint.Value, IsTextUnderPrevPoint, cellSizeLast);
        }