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

Call method after the chart has been loaded, including animation

8 Answers 77 Views
Chart
This is a migrated thread and some comments may be shown as answers.
adriel silva
Top achievements
Rank 1
adriel silva asked on 14 Feb 2011, 12:32 PM
Hi,

I need to call a method after the chart has been loaded, including animation.
Is there some event or a way to do this?

Att,

8 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 17 Feb 2011, 09:19 AM
Hi adriel silva,

Unfortunately RadChart does not have an event that can be thrown after the animation is completed. Please excuse us for the inconvenience caused.

Kind regards,
Nikolay
the Telerik team
0
adriel silva
Top achievements
Rank 1
answered on 17 Feb 2011, 07:55 PM
Hi,

Is there a way to find out how long the animation will last?
Is there a calculation I can do to find out how long will it take?

I'm having problems doing a load in the layout of RadDocking while the animation of the graphic is running.
I need to call the LoadLayout method RadDocking after the animation has finished.

Att,
0
Accepted
Nikolay
Telerik team
answered on 22 Feb 2011, 09:10 AM
Hi adriel silva,

You may set the following properties for the chart animation :
  • ItemDelay - this property specifies the delay for each series item toward the previous one. For example, if you have bar chart, when a bar item animation is started, the next bar item will start its animation with the delay specified by this property.
  • TotalSeriesAnimationDuration - specifies how long will take the animation duration for a single series.
  • ItemAnimationDuration – specifies how long will take the animation duration of each series item.
  • DefaultSeriesDelay - controls when the rendering of the next series should start, compared to the previous one (i.e. the series index is taken into account). For example, if you have three series and DefaultSeriesDelay is set to 10 sec for each of them – the rendering of the 2nd series will begin 10 seconds after the first one is complete, respectively the rendering of the 3rd – 10 seconds after the second is complete.
The easiest way to know the exact animation duration would be to set the TotalSeriesAnimationDuration property to the desired value. The other way would be to calculate the ItemAnimationDuration times the number of items + (number of items - 1)* ItemDelay. Please, note that the animations are different for the different series.

For more information on chart animations, please, have a look at this help topic.

Regards,
Nikolay
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Scott
Top achievements
Rank 1
answered on 01 Aug 2011, 11:51 PM
This would be a very nice event to have. It seems that you cannot select an item before the animation is complete. If I had an event I could do the selection then.
0
Nikolay
Telerik team
answered on 04 Aug 2011, 07:43 AM
Hi Scott,

Our developers have been notified about the demand for such an event and will consider adding it for one of the future versions of the control.

As for selecting an item before the animation is complete, you may consider pre-selecting the desired item from code in case you know which one exactly you would need to select. Would this approach be useful in your specific scenario? 

Kind regards,
Nikolay
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
0
Scott
Top achievements
Rank 1
answered on 04 Aug 2011, 04:48 PM
Hi Nikolay, not exactly sure what you mean because I tried to select the item right away and it didn't work.

What I did was start a DispatecherTimer that tried to select the appropriate item. Each tick I would see if an item was selected and it it was I would stop the timer. If nothing was selected I would try again. Seems to work fine and it can select the item before the animation is done.

Thanks for the help.
0
Nikolay
Telerik team
answered on 09 Aug 2011, 08:35 AM
Hello Scott,

Using Dispatcher.BeginInvoke() approach was what I meant. Here is a sample code snippet to refer to :
DataSeries series = new DataSeries();
series.Definition = new PieSeriesDefinition();
series.Definition.InteractivitySettings.SelectionMode = ChartSelectionMode.Single;
series.Definition.InteractivitySettings.SelectionScope = InteractivityScope.Item;
  
series.Add(new DataPoint(1));
series.Add(new DataPoint(2));
series.Add(new DataPoint(3));
RadChart1.DefaultView.ChartArea.DataSeries.Add(series);
   
Dispatcher.BeginInvoke((Action)(() => RadChart1.DefaultView.ChartArea.SelectItem(1)));

Hope this helps.

All the best,
Nikolay
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
0
Scott
Top achievements
Rank 1
answered on 09 Aug 2011, 11:25 PM
Nikolay, your approach works and is better than my timer approach. Thanks for the info.
Tags
Chart
Asked by
adriel silva
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
adriel silva
Top achievements
Rank 1
Scott
Top achievements
Rank 1
Share this question
or