RadStacked100DataBar animation on value change

4 posts, 0 answers
  1. Rosca
    Rosca avatar
    3 posts
    Member since:
    Jul 2017

    Posted 11 Jul Link to this post

    Hello all,

     

    I am using a RadStacked100DataBar in order to display a percentage like fill bar (like in the attached image).

    The value/s can change on refresh data, I would need an animation of the colored bar width changing. Is there a way to achieve this?

    Thank you.

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1408 posts

    Posted 14 Jul Link to this post

    Hi Rosca,

    The stacked data bar control doesn't support animations out of the box. However, you can achieve your requirement by writing some custom code. For example, when you set a new value, you can start a DisptacherTimer and update the value with smaller step until it gets to the newly set value. This way it will look like the value is animated smoothly. Check this approach in the attached project.

    Additionally, you can consider using RadProgressBar. This way you will need to manage only one value, instead of one for each bar.

    Regards,
    Martin Ivanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. Rosca
    Rosca avatar
    3 posts
    Member since:
    Jul 2017

    Posted 14 Jul in reply to Martin Ivanov Link to this post

    Hi Martin,

    Thank you for your response. The timer/task approach is what I have implemented so far, and I am changing the LeftPercentage and RightPercentage of the DataBarShape -  the problem is that the control needs to be first updated and then I am able to simulate the required animation behaviour. I will take into consideration the ProgressBar appraoch as well.

  4. Rosca
    Rosca avatar
    3 posts
    Member since:
    Jul 2017

    Posted 19 Jul in reply to Martin Ivanov Link to this post

    Hi All, 

    Maybe this will help others. In the end I decided to replace RadStacked100DataBar with RadProgressBar as Martin suggested. 

    It works like a charm.

    Thank you,

    Dan

Back to Top