private void TrackTimeLine(MouseEventArgs e)
        {
            string          timeLabel = string.Empty;
            EnergyCurveView curveView = (EnergyCurveView)this.CurveView;

            Point  point   = e.GetPosition((UIElement)curveView.View);
            double x       = point.X;
            double centerX = curveView.CenterX;

            if (x >= 0)
            {
                double v     = (x - centerX) / scale + centerX;
                double index = v / Grad / IntervalCount;

                timeLabel = this.GetFormatDateTime(this.currentBaseTime, index, IntervalCount * this.Interval);
            }

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

            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 / Grad / IntervalCount;

                timeLabel = this.GetFormatDateTime(this.currentBaseTime, index, IntervalCount * this.Interval);
            }

            curveView.TrackTimeLine(point, timeLabel);

            /*
             * foreach (var view in this.ChartContainer.Children)
             * {
             *  EnergyCurveView curveView = (EnergyCurveView)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 / Grad / IntervalCount;
             *
             *      timeLabel = this.GetFormatDateTime(this.currentBaseTime, index, IntervalCount * this.Interval);
             *  }
             *
             *  curveView.TrackTimeLine(point, timeLabel);
             * }*/
        }