Xamarin.Android | ComponentOne
Controls / Gauge / Features / Animation
In This Topic
    Animation
    In This Topic

    Gauge allows you to enable animation effects using one of the two ways, either on loading when the gauge is drawn or on updating when the gauge is redrawn after modifications. It supports animation in gauge through C1Animation class available in the C1.Android.Core namespace.

    The following GIF shows animation in Radial Gauge.

    You can also set the duration of the animation in gauge using Duration property and interpolate the values of animation using Easing property of the C1Animation class, which accepts values from the C1Easing class. This class supports a collection of standard easing functions such as CircleIn, CircleOut, and Linear.

    C#
    Copy Code
    C1Animation animate = new C1Animation();
    // set update animation duration
    animate.Duration = new TimeSpan(1500 * 15000);
    // interpolate the values of animation
    animate.Easing = C1Easing.Linear;

    In addition to easing functions of C1Easing class, FlexPie supports built in easing functions of Xamarin.Forms.Easing class. For more information, refer Xamarin Easing Class.

    You can show animation while loading or updating a gauge. To show animation while loading, use LoadAnimation property of the ChartBase class. This property gets the load animation from the object of C1Animation class to display the animation at the time of loading gauge. Similarly, to animate the gauge when underlying data collection changes on adding, removing, or modifying a value, you can use UpdateAnimation property of the ChartBase class.

    C#
    Copy Code
    // set the loading animation easing
    mRadialGauge.LoadAnimation = animate;