Example #1
0
 private void UpdateBounds(IPointDataSource dataSource)
 {
     if (Plotter2D != null)
     {
         var  transform = GetTransform();
         Rect bounds    = BoundsHelper.GetViewportBounds(dataSource.GetPoints(), transform.DataTransform);
         ContentBounds = bounds;
     }
 }
Example #2
0
        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);
            }
        }