This is a migrated thread and some comments may be shown as answers.

RadStacked100DataBar animation on value change

3 Answers 77 Views
DataBar
This is a migrated thread and some comments may be shown as answers.
Rosca
Top achievements
Rank 1
Rosca asked on 11 Jul 2017, 09:51 AM

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.

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 14 Jul 2017, 09:31 AM
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.
0
Rosca
Top achievements
Rank 1
answered on 14 Jul 2017, 09:40 AM

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.

0
Rosca
Top achievements
Rank 1
answered on 19 Jul 2017, 10:57 AM

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

Tags
DataBar
Asked by
Rosca
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Rosca
Top achievements
Rank 1
Share this question
or