public override void ApplyState(
            SceneModifier modifier,
            RectangleF diagramBounds,
            BarSeriesPointLayoutParameters barParameters,
            float progress)
        {
            float startPositionX = diagramBounds.Left + diagramBounds.Width / 2;
            float startPositionY = diagramBounds.Top + diagramBounds.Height / 2;

            RectangleF barBounds    = barParameters.Bounds;
            float      endPositionX = barBounds.Left + barBounds.Width / 2;
            float      endPositionY = barBounds.Top + barBounds.Height / 2;

            // Moves bar from the diagram center to its position on the diagram.
            modifier.Translate(
                (startPositionX - endPositionX) * (1 - progress),
                (startPositionY - endPositionY) * (1 - progress)
                );

            // Scales bar.
            // Note that methods requiered for correct transform are called in inverse order.
            // This is a feature of affine transformations.
            modifier.Translate(endPositionX, endPositionY);
            modifier.Scale(progress, progress);
            modifier.Translate(-endPositionX, -endPositionY);
        }
 public override void ApplyState(
     SceneModifier modifier,
     RectangleF diagramBounds,
     MarkerSeriesPointLayoutParameters markerParameters,
     float progress)
 {
     modifier.Translate(-markerParameters.Bounds.Right * (1 - progress), 0);
 }
예제 #3
0
        public override void ApplyState(SceneModifier modifier, Rectangle diagramBounds, float progress)
        {
            float currentWidth  = diagramBounds.Width * progress;
            float currentHeight = diagramBounds.Height * progress;

            float diagramCenterX = diagramBounds.X + diagramBounds.Width / 2.0f;
            float diagramCenterY = diagramBounds.Y + diagramBounds.Height / 2.0f;

            float dx = (currentWidth - diagramBounds.Width) / 2;
            float dy = (currentHeight - diagramBounds.Height) / 2;

            modifier.Translate(-dx, -dy);
            modifier.Scale(progress, progress);

            modifier.Translate(diagramCenterX, diagramCenterY);
            modifier.Rotate(progress * 360 * RotationCount);
            modifier.Translate(-diagramCenterX, -diagramCenterY);
        }
예제 #4
0
        public override void ApplyState(
            SceneModifier modifier,
            RectangleF diagramBounds,
            PieSeriesPointLayoutParameters pieParameters,
            float progress
            )
        {
            float pieCenterX = pieParameters.PieCenter.X;
            float pieCenterY = pieParameters.PieCenter.Y;
            float scale      = (progress <= 0.5)
                ? 1 - 0.2f * progress
                : 0.8f + 0.2f * progress;

            // Note that methods requiered for correct transform are called in inverse order.
            // This is a feature of affine transformations.
            modifier.Translate(pieCenterX, pieCenterY);
            modifier.Scale(scale, scale);
            modifier.Translate(-pieCenterX, -pieCenterY);
        }