/// <summary> /// Initializes a new instance of the <see cref="TrackerManipulator" /> class. /// </summary> /// <param name="plotView">The plot view.</param> public TrackerManipulator(IPlotView plotView) : base(plotView) { this.Snap = true; this.PointsOnly = false; this.LockToInitialSeries = true; }
private void HandleZoomByWheelAndCtrl(IPlotView view, OxyMouseWheelEventArgs args, double factor = 1) { var m = new CustomZoomStepManipulator(view, EAxisDescription.Y) { Step = args.Delta * 0.001 * factor }; m.Started(args); }
/// <summary> /// Zooms the view by the specified factor at the position specified in the <see cref="OxyMouseEventArgs" />. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyMouseWheelEventArgs" /> instance containing the event data.</param> /// <param name="delta">The zoom factor.</param> private static void HandleZoomAt(IPlotView view, OxyMouseEventArgs args, double delta) { var m = new ZoomStepManipulator(view) { Step = delta, FineControl = args.IsControlDown }; m.Started(args); }
/// <summary> /// Zooms the view by the mouse wheel delta in the specified <see cref="OxyKeyEventArgs" />. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyMouseWheelEventArgs" /> instance containing the event data.</param> /// <param name="factor">The zoom speed factor. Default value is 1.</param> private static void HandleZoomByWheel(IPlotView view, OxyMouseWheelEventArgs args, double factor = 1) { var m = new ZoomStepManipulator(view) { Step = args.Delta * 0.001 * factor, FineControl = args.IsControlDown }; m.Started(args); }
/// <summary> /// Initializes a new instance of the <see cref="TouchTrackerManipulator" /> class. /// </summary> /// <param name="plotView">The plot view.</param> public TouchTrackerManipulator(IPlotView plotView) : base(plotView) { this.Snap = true; this.PointsOnly = false; this.LockToInitialSeries = true; // Note: the tracker manipulator should not handle pan or zoom this.SetHandledForPanOrZoom = false; }
/// <summary> /// Add chart plot view object. /// </summary> /// <param name="view">Chart plot view object.</param> protected virtual void AddPlotViewLayer(IPlotView view) { if (this.PlotViewContainer != null) { view.Bounds = this.PlotViewContainer.ClientBounds; this.PlotViewContainer.Children.Add(view); } this.Invalidate(); }
private void CopyChart_OnKeyDown( IPlotView view, IController controller, OxyKeyEventArgs args) { var chartCopy = new Bitmap(uiPlotView.Width, uiPlotView.Height); uiPlotView.DrawToBitmap(chartCopy, new Rectangle(0, 0, uiPlotView.Width, uiPlotView.Height)); Clipboard.SetImage(chartCopy); }
/// <summary> /// Performs the copy operation. /// </summary> private void DoCopy(IPlotView view, OxyInputEventArgs args) { var exporter = new PngExporter { Width = this.ClientRectangle.Width, Height = this.ClientRectangle.Height, }; var bitmap = exporter.ExportToBitmap(this.ActualModel); Clipboard.SetImage(bitmap); }
public StayOpenTrackerManipulator(IPlotView plot) : base(plot) { _plotModel = plot != null ? plot.ActualModel : null; if (_plotModel == null) { throw new ArgumentException("Plot has no model", "plot"); } Snap = true; PointsOnly = false; }
/// <summary> /// Attaches this model to the specified plot view. /// </summary> /// <param name="plotView">The plot view.</param> /// <remarks>Only one plot view can be attached to the plot model. /// The plot model contains data (e.g. axis scaling) that is only relevant to the current plot view.</remarks> void IPlotModel.AttachPlotView(IPlotView plotView) { var currentPlotView = this.PlotView; if (!object.ReferenceEquals(currentPlotView, null) && !object.ReferenceEquals(plotView, null) && !object.ReferenceEquals(currentPlotView, plotView)) { throw new InvalidOperationException( "This PlotModel is already in use by some other PlotView control."); } this.plotViewReference = (plotView == null) ? null : new WeakReference(plotView); }
void IPlotModel.AttachPlotView(IPlotView plotView) { //because of issue https://github.com/oxyplot/oxyplot/issues/497 //only one view can ever be attached to one plotmodel //we have to force detach previous view and then attach new one if (plotView != null && PlotView != null && !Equals(plotView, PlotView)) { BaseAttachMethod.Invoke(this, new object[] { null }); BaseAttachMethod.Invoke(this, new object[] { plotView }); } else { BaseAttachMethod.Invoke(this, new object[] { plotView }); } }
/// <summary> /// Performs the copy operation. /// </summary> private void DoCopy(IPlotView view, OxyInputEventArgs args) { var background = this.ActualModel.Background.IsVisible() ? this.ActualModel.Background : this.ActualModel.Background; if (background.IsInvisible()) { background = OxyColors.White; } var exporter = new PngExporter { Width = this.ClientRectangle.Width, Height = this.ClientRectangle.Height, Background = background }; var bitmap = exporter.ExportToBitmap(this.ActualModel); Clipboard.SetImage(bitmap); }
public void Append(IPlotView plot, dynamic j) { if (j.Flag == 1) { System.Diagnostics.Debugger.Break(); } // the first message (with data) sets the keys to plot if (Series.Count == 0) { List <string> keys = Util.GetMemberNames(j, true); keys.Remove("T"); keys.Remove("Time"); keys.Remove("Flag"); foreach (string k in keys) { Series.Add(new LineSeries { Title = k }); } } foreach (LineSeries ls in Series) { while (ls.Points.Count > pointLimit) { ls.Points.RemoveAt(0); } try { ls.Points.Add(new DataPoint((double)j.Time, (double)j[ls.Title])); } catch (Exception) { Series.Remove(ls); break; } } plot.InvalidatePlot(); }
/// <summary> /// Handles the reset event. /// </summary> /// <param name="view">The view to reset.</param> /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param> private static void HandleReset(IPlotView view, OxyInputEventArgs args) { args.Handled = true; view.ActualModel.ResetAllAxes(); view.InvalidatePlot(false); }
/// <summary> /// Initializes a new instance of the <see cref="ZoomStepManipulator" /> class. /// </summary> /// <param name="plotView">The plot view.</param> public ZoomStepManipulator(IPlotView plotView) : base(plotView) { }
/// <summary> /// Zooms the view by the key in the specified factor. /// </summary> /// <param name="view">The view.</param> /// <param name="delta">The zoom factor (positive zoom in, negative zoom out).</param> private static void HandleZoomCenter(IPlotView view, double delta) { view.ActualModel.ZoomAllAxes(1 + (delta * 0.12)); view.InvalidatePlot(false); }
/// <summary> /// Zooms the view by the key in the specified factor. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param> /// <param name="delta">The zoom factor (positive zoom in, negative zoom out).</param> private static void HandleZoomCenter(IPlotView view, OxyInputEventArgs args, double delta) { args.Handled = true; view.ActualModel.ZoomAllAxes(1 + (delta * 0.12)); view.InvalidatePlot(false); }
/// <summary> /// Pans the view by the key in the specified vector. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param> /// <param name="dx">The horizontal delta (percentage of plot area width).</param> /// <param name="dy">The vertical delta (percentage of plot area height).</param> private static void HandlePan(IPlotView view, OxyInputEventArgs args, double dx, double dy) { args.Handled = true; dx *= view.ActualModel.PlotArea.Width; dy *= view.ActualModel.PlotArea.Height; view.ActualModel.PanAllAxes(dx, dy); view.InvalidatePlot(false); }
public void AttachPlotView(IPlotView plotView) { }
/// <summary> /// Pans the view by the key in the specified vector. /// </summary> /// <param name="view">The view.</param> /// <param name="dx">The horizontal delta (percentage of plot area width).</param> /// <param name="dy">The vertical delta (percentage of plot area height).</param> private static void HandlePan(IPlotView view, double dx, double dy) { dx *= view.ActualModel.PlotArea.Width; dy *= view.ActualModel.PlotArea.Height; view.ActualModel.PanAllAxes(dx, dy); view.InvalidatePlot(false); }
public virtual bool OnSignalDropped(IPlotView view, ScreenPoint point, ISignalViewModel signal) { return(true); }
/// <summary> /// Attaches this model to the specified plot view. /// </summary> /// <param name="plotView">The plot view.</param> /// <remarks>Only one plot view can be attached to the plot model. /// The plot model contains data (e.g. axis scaling) that is only relevant to the current plot view.</remarks> void IPlotModel.AttachPlotView(IPlotView plotView) { this.plotViewReference = (plotView == null) ? null : new WeakReference(plotView); }
/// <summary> /// Initializes a new instance of the <see cref="PanManipulator" /> class. /// </summary> /// <param name="plotView">The plot view.</param> public PanManipulator(IPlotView plotView) : base(plotView) { }
public TapTouchManipulator(IPlotView plotView, ICommand tapCommand) : base(plotView) { this.tapCommand = tapCommand; }
/// <summary> /// Handles the copy code event. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyInputEventArgs"/> instance containing the event data.</param> private static void HandleCopyCode(IPlotView view, OxyInputEventArgs args) { args.Handled = true; var code = view.ActualModel.ToCode(); view.SetClipboardText(code); }
/// <summary> /// Handles the copy text report event. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyInputEventArgs"/> instance containing the event data.</param> private static void HandleCopyTextReport(IPlotView view, OxyInputEventArgs args) { args.Handled = true; var text = view.ActualModel.CreateTextReport(); view.SetClipboardText(text); }
/// <summary> /// Initializes a new instance of the <see cref="PlotManipulator{T}" /> class. /// </summary> /// <param name="view">The plot view.</param> protected PlotManipulator(IPlotView view) : base(view) { this.PlotView = view; }
/// <summary> /// Handles the reset events. /// </summary> /// <param name="view">The view to reset.</param> private static void HandleReset(IPlotView view) { view.ActualModel.ResetAllAxes(); view.InvalidatePlot(false); }
/// <summary> /// Handles the copy text report event. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyInputEventArgs"/> instance containing the event data.</param> private static void HandleCopyTextReport(IPlotView view, OxyInputEventArgs args) { args.Handled = true; // var text = view.ActualModel.CreateTextReport(); //view.SetClipboardText(text); }
/// <summary> /// Initializes a new instance of the <see cref="TouchManipulator" /> class. /// </summary> /// <param name="plotView">The plot view.</param> public TouchManipulator(IPlotView plotView) : base(plotView) { SetHandledForPanOrZoom = true; }
/// <summary> /// Initializes a new instance of the <see cref="TouchManipulator" /> class. /// </summary> /// <param name="plotView">The plot view.</param> public TouchManipulator(IPlotView plotView) : base(plotView) { }
public StaysOpenTrackerManipulator(IPlotView plotView) : base(plotView) { Snap = true; PointsOnly = true; }
public CustomPanManipulator(IPlotView plotView, EAxisDescription axisDescription) : base(plotView) { AxisDescription = axisDescription; }
private static void AddStayOpenTrackerManipulator(IPlotView view, IController controller, OxyMouseDownEventArgs e) { controller.AddMouseManipulator(view, new StayOpenTrackerManipulator(view), e); }
/// <summary> /// Initializes a new instance of the <see cref="MouseManipulator" /> class. /// </summary> /// <param name="plotView">The plot view.</param> protected MouseManipulator(IPlotView plotView) : base(plotView) { }
/// <summary> /// Initializes a new instance of the <see cref="ZoomRectangleManipulator" /> class. /// </summary> /// <param name="plotView">The plot view.</param> public ZoomRectangleManipulator(IPlotView plotView) : base(plotView) { }