Xuni Product Documentation - Xamarin.Forms
Animation

You can choose to enhance the user experience of FlexPie by enabling and configuring animation effects to the pie slices upon load, update and selection. By default, animation is enabled. You can disable animation by setting is the IsAnimated property.

The following code example demonstrates how to set this property in C# . The example uses the sample created in the Quick Start section.

In Code

C#
Copy Code
// disable animation
chart.IsAnimated = false;

You can configure the animation start delay and duration in milliseconds.

In Code

C#
Copy Code
// set load animation start delay to 1 millisecond
chart.LoadAnimation.StartDelay = 1000;

// set update and select animation duration to 2 milliseconds
chart.UpdateAnimation.Duration = 2000;
chart.SelectAnimation.Duration = 2000;

The update animation occurs when the underlying data collection changes by adding a value, removing a value or modifying a value. To support update animation you should use either an ObservableCollection or a XuniCollectionView as your data source.

The load animation occurs when the chart initially loads. You can change the fundamental loading animation effect by setting the AnimationMode property. FlexPie supports two different animation modes: All or Point(default).

In Code

C#
Copy Code
// set the loading animation mode
chart.LoadAnimation.AnimationMode = ChartAnimationModes.All;

You can configure the animation further by setting the easing function that is applied to the animation. FlexPie supports a collection of standard easing functions such as cubic in/out, spring in/out, bounce in/out and linear. The default animation easing is Cubic In.

In Code

C#
Copy Code
// set the loading animation easing
chart.LoadAnimation.Easing = ChartEasing.CubicOut;

 

 


Copyright © GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback