Beispiel #1
0
        private void TrackTimeLine(MouseEventArgs e, bool calculation)
        {
            if (this.disableTracking)
            {
                return;
            }

            string    timeLabel = string.Empty;
            CurveView curveView = (CurveView)this.CurveView;

            Point  point = e.GetPosition((UIElement)curveView.CanvasView);
            double x     = point.X;

            // 暂时屏蔽TrackingLine功能
            if (false && calculation && x >= 0)
            {
                double index = x * this.currentGraduationCount / this.currentGraduation;
                timeLabel = this.GetFormatDateTime(this.currentBaseTime, (int)index, this.Interval);
            }

            curveView.TrackTimeLine(point, timeLabel, calculation);
        }
Beispiel #2
0
        private void TrackTimeLine(MouseEventArgs e)
        {
            bool   timed     = false;
            string timeLabel = string.Empty;

            foreach (var view in this.ChartContainer.Children)
            {
                CurveView curveView = (CurveView)view;

                Point  point   = e.GetPosition((UIElement)curveView.View);
                double x       = point.X;
                double centerX = curveView.CenterX;
                if (!timed && x >= 0)
                {
                    double v = (x - centerX) / scale + centerX;

                    double index = v / Graduation / 5;
                    timeLabel = this.GetFormatDateTime(this.currentBaseTime, (int)index, this.Interval);
                }

                curveView.TrackTimeLine(point, timeLabel);
            }
        }