コード例 #1
0
 private void UpdateBounds(IPointDataSource dataSource)
 {
     if (Plotter2D != null)
     {
         var  transform = GetTransform();
         Rect bounds    = BoundsHelper.GetViewportBounds(dataSource.GetPoints(), transform.DataTransform);
         ContentBounds = bounds;
     }
 }
コード例 #2
0
ファイル: LineGraph.cs プロジェクト: simple689/WPF
        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);
            }
        }
コード例 #3
0
 public static Rect GetBounds(this IEnumerable <Point> points)
 {
     return(BoundsHelper.GetDataBounds(points));
 }