/// <summary>
        /// Occurs when a manipulation is complete.
        /// </summary>
        /// <param name="e">
        /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
        /// </param>
        public override void Completed(ManipulationEventArgs e)
        {
            base.Completed(e);

            if (this.currentSeries == null)
            {
                return;
            }

            this.currentSeries = null;
            this.PlotControl.HideTracker();
        }
        /// <summary>
        /// Occurs when the input device changes position during a manipulation.
        /// </summary>
        /// <param name="e">
        /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
        /// </param>
        public override void Delta(ManipulationEventArgs e)
        {
            base.Delta(e);
            if (this.currentSeries == null)
            {
                return;
            }

            if (!this.PlotControl.ActualModel.PlotArea.Contains(e.CurrentPosition.X, e.CurrentPosition.Y))
            {
                return;
            }

            TrackerHitResult result = GetNearestHit(this.currentSeries, e.CurrentPosition, this.Snap, this.PointsOnly);

            if (result != null)
            {
                result.PlotModel = this.PlotControl.ActualModel;
                this.PlotControl.ShowTracker(result);
            }
        }
        /// <summary>
        /// Occurs when a manipulation is complete.
        /// </summary>
        /// <param name="e">
        /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
        /// </param>
        public override void Completed(ManipulationEventArgs e)
        {
            base.Completed(e);

            this.PlotControl.HideZoomRectangle();

            if (this.ZoomRectangle.Width > 10 && this.ZoomRectangle.Height > 10)
            {
                DataPoint p0 = this.InverseTransform(this.ZoomRectangle.Left, this.ZoomRectangle.Top);
                DataPoint p1 = this.InverseTransform(this.ZoomRectangle.Right, this.ZoomRectangle.Bottom);

                if (this.XAxis != null)
                {
                    this.PlotControl.Zoom(this.XAxis, p0.X, p1.X);
                }

                if (this.YAxis != null)
                {
                    this.PlotControl.Zoom(this.YAxis, p0.Y, p1.Y);
                }

                this.PlotControl.InvalidatePlot();
            }
        }
Beispiel #4
0
        /// <summary>
        /// Occurs when a manipulation is complete.
        /// </summary>
        /// <param name="e">
        /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
        /// </param>
        public override void Completed(ManipulationEventArgs e)
        {
            base.Completed(e);

            this.PlotControl.HideZoomRectangle();

            if (this.ZoomRectangle.Width > 10 && this.ZoomRectangle.Height > 10)
            {
                DataPoint p0 = this.InverseTransform(this.ZoomRectangle.Left, this.ZoomRectangle.Top);
                DataPoint p1 = this.InverseTransform(this.ZoomRectangle.Right, this.ZoomRectangle.Bottom);

                if (this.XAxis != null)
                {
                    this.PlotControl.Zoom(this.XAxis, p0.X, p1.X);
                }

                if (this.YAxis != null)
                {
                    this.PlotControl.Zoom(this.YAxis, p0.Y, p1.Y);
                }

                this.PlotControl.InvalidatePlot();
            }
        }
 /// <summary>
 /// Occurs when the input device changes position during a manipulation.
 /// </summary>
 /// <param name="e">
 /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
 /// </param>
 public virtual void Delta(ManipulationEventArgs e)
 {
 }
 /// <summary>
 /// Occurs when a manipulation is complete.
 /// </summary>
 /// <param name="e">
 /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
 /// </param>
 public virtual void Completed(ManipulationEventArgs e)
 {
     this.PlotControl.SetCursorType(CursorType.Default);
 }
        /// <summary>
        /// Occurs when an input device begins a manipulation on the plot.
        /// </summary>
        /// <param name="e">
        /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
        /// </param>
        public virtual void Started(ManipulationEventArgs e)
        {
            Axis xaxis;
            Axis yaxis;
            this.PlotControl.GetAxesFromPoint(e.CurrentPosition, out xaxis, out yaxis);
            this.StartPosition = e.CurrentPosition;

            this.XAxis = xaxis;
            this.YAxis = yaxis;

            this.PlotControl.SetCursorType(this.GetCursorType());
        }
        /// <summary>
        /// Occurs when the input device changes position during a manipulation.
        /// </summary>
        /// <param name="e">
        /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
        /// </param>
        public override void Delta(ManipulationEventArgs e)
        {
            base.Delta(e);

            OxyRect plotArea = this.PlotControl.ActualModel.PlotArea;

            double x = Math.Min(this.StartPosition.X, e.CurrentPosition.X);
            double w = Math.Abs(this.StartPosition.X - e.CurrentPosition.X);
            double y = Math.Min(this.StartPosition.Y, e.CurrentPosition.Y);
            double h = Math.Abs(this.StartPosition.Y - e.CurrentPosition.Y);

            if (this.XAxis == null)
            {
                x = plotArea.Left;
                w = plotArea.Width;
            }

            if (this.YAxis == null)
            {
                y = plotArea.Top;
                h = plotArea.Height;
            }

            this.ZoomRectangle = new OxyRect(x, y, w, h);
            this.PlotControl.ShowZoomRectangle(this.ZoomRectangle);
        }
 /// <summary>
 /// Occurs when an input device begins a manipulation on the plot.
 /// </summary>
 /// <param name="e">
 /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
 /// </param>
 public override void Started(ManipulationEventArgs e)
 {
     base.Started(e);
     this.ZoomRectangle = new OxyRect(this.StartPosition.X, this.StartPosition.Y, 0, 0);
     this.PlotControl.ShowZoomRectangle(this.ZoomRectangle);
 }
 /// <summary>
 /// Occurs when an input device begins a manipulation on the plot.
 /// </summary>
 /// <param name="e">
 /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
 /// </param>
 public override void Started(ManipulationEventArgs e)
 {
     base.Started(e);
     this.currentSeries = this.PlotControl.GetSeriesFromPoint(e.CurrentPosition);
     this.Delta(e);
 }
Beispiel #11
0
 /// <summary>
 /// Occurs when an input device begins a manipulation on the plot.
 /// </summary>
 /// <param name="e">
 /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
 /// </param>
 public override void Started(ManipulationEventArgs e)
 {
     base.Started(e);
     this.ZoomRectangle = new OxyRect(this.StartPosition.X, this.StartPosition.Y, 0, 0);
     this.PlotControl.ShowZoomRectangle(this.ZoomRectangle);
 }
        /// <summary>
        /// Occurs when the input device changes position during a manipulation.
        /// </summary>
        /// <param name="e">
        /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
        /// </param>
        public override void Delta(ManipulationEventArgs e)
        {
            base.Delta(e);
            if (this.currentSeries == null)
            {
                return;
            }

            if (!this.PlotControl.ActualModel.PlotArea.Contains(e.CurrentPosition.X, e.CurrentPosition.Y))
            {
                return;
            }

            TrackerHitResult result = GetNearestHit(this.currentSeries, e.CurrentPosition, this.Snap, this.PointsOnly);
            if (result != null)
            {
                result.PlotModel = this.PlotControl.ActualModel;
                this.PlotControl.ShowTracker(result);
            }
        }
 /// <summary>
 /// Occurs when an input device begins a manipulation on the plot.
 /// </summary>
 /// <param name="e">
 /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
 /// </param>
 public override void Started(ManipulationEventArgs e)
 {
     base.Started(e);
     this.currentSeries = this.PlotControl.GetSeriesFromPoint(e.CurrentPosition);
     this.Delta(e);
 }
 /// <summary>
 /// Occurs when the input device changes position during a manipulation.
 /// </summary>
 /// <param name="e">
 /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
 /// </param>
 public virtual void Delta(ManipulationEventArgs e)
 {
 }
 /// <summary>
 /// Occurs when a manipulation is complete.
 /// </summary>
 /// <param name="e">
 /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.
 /// </param>
 public virtual void Completed(ManipulationEventArgs e)
 {
     this.PlotControl.SetCursorType(CursorType.Default);
 }