Silverlight chart load time measurement

I am trying to measure how long it takes for different Silverlight chart libraries (e.g. Silverlight Control Toolkit, Visifire, Telerik) to load onto the screen.

My problem is that I can measure the time until the control is loaded and the drawing starts to happen on the screen, however, the rendering takes longer due to animation effects (like damping of dots).

Is there a chance that I will be able to set up some kind of automatic way to detect when the rendering has finished? My problem is that I found the Loaded event handler in the Silverlight Framework element, which only the notification of the start of rendering is clicked on.

The sample code that I am currently using for the Silverlight Control Toolkit is as follows:

public void Init() { Chart chart = new Chart(); // Init chart object DataPointSeries series; (...)// Init series, add lots of points, set data binding Chart.Series.Add(series); // Add series to chart chart.Loaded += new RoutedEventHandler(Chart_Loaded); LayoutRoot.Children.Add(chart); StartTimer(); // Start timer and wait for control to load } public void Chart_Loaded(object sender, RoutedEventArgs e) { StopTimer(); // Problem: rendering just started at this point, hasn't finished yet! } 
+4
source share
2 answers

I found some workarounds for some chart libraries, but for some others I didn’t. Below are the events that I could connect to get a realistic measurement time:

Dundas Charts:

 Chart chart; Chart.ImageReady += new ImageDownloaded(Chart_ImageReady); // Stop timer at this event 

Silverlight Toolkit:

 Chart chart; DataPointSeries series; Chart.Series.Add(series); Chart.Series[0].Loaded += new RoutedEventHandler(Chart_Loaded); // Stop timer at this event 

Steema TeeChart:

 TChart chart; chart.AfterDraw += new PaintChartEventHandler(chart_AfterDraw); // Stop timer at this event 

Telerik RAD Cards:

 RadChart chart; chart.DefaultView.ChartArea.Loaded += new RoutedEventHandler(Chart_Loaded); // Stop timer at this event 

Visifire

 Chart chart; chart.AnimationEnabled = false; // Turn off animation chart.Loaded += new RoutedEventHandler(Chart_Loaded); // Stop timer at this event 

The only library that I could not connect to the event that was triggered at the right time was for Infagristics Netadvantage.

+4
source

In case you are trying to compare performance, I think turning on the animation is not the best way to determine the rendering time of the control, because different animations can take a different amount of time.

I would prefer that you turn off the animation if this was possible during testing. In Visifire, you can do this by setting the AnimationEnabled property of the chart to false. I do not really understand others. And when doing such tests, you can make the differences more obvious using a huge amount of DataPoints (4K-5K).

+2
source

All Articles