private void UpdateBounds(IPointDataSource dataSource) { if (Plotter2D != null) { var transform = GetTransform(); Rect bounds = BoundsHelper.GetViewportBounds(dataSource.GetPoints(), transform.DataTransform); ContentBounds = bounds; } }
protected override void UpdateCore() { if (DataSource == null) { return; } Rect output = Viewport.Output; var transform = GetTransform(); if (filteredPoints == null || !(transform.DataTransform is IdentityTransform)) { IEnumerable <Point> points = GetPoints(); ContentBounds = BoundsHelper.GetViewportBounds(points, transform.DataTransform); transform = GetTransform(); List <Point> transformedPoints = transform.DataToScreen(points); // Analysis and filtering of unnecessary points filteredPoints = new FakePointList(FilterPoints(transformedPoints), output.Left, output.Right); Offset = new Vector(); } else { double left = output.Left; double right = output.Right; double shift = Offset.X; left -= shift; right -= shift; filteredPoints.SetXBorders(left, right); } }
public static Rect GetBounds(this IEnumerable <Point> points) { return(BoundsHelper.GetDataBounds(points)); }