Telerik blogs

As we know, the RadSparklines are characterized by their small memory footprint, cleaner XAML and simple but powerful rendering. When looking at the sparkline controls in the context of a charting tool one has to note that they are much more simplified. They lack many of the visual elements, such as Axis lines, gridlines or striplines. This makes them much faster when rendered and very suitable when used in high data-intensity scenarios. One such scenario may be when using different types of sparklines bound to a ViewModel/class, which passes hundreds or even thousands of data points to the controls.

 

Since the RadSparklines are very lightweight, one can both refresh the data frequently, and what is even more important, include a large number of such controls on the page. One such setup may look like this:

 

image

 

Additionally, the Sparkline controls include an optimized handling when bound to collections which implement INotifyPropertyChanged and INotifyCollectionChanged. In such cases adding, removing and updating the collection updates the Sparkline properly, refreshing the content only partially in most of the cases which further boosts the performance.

 

To visualize the performance of the controls, we included a 25 x 4 grid, with a Linear Sparkline nested in each cell. The initial test used 40 points per sparkline. Below you can see a screenshot of the example, showing a total 4000 data points. The time needed to refresh such a setup was 109 milliseconds:

 

image

 

Even when we dramatically increased the number of data points in the 100 sparklines rendered on the page to a total of 20000, the responsiveness remained stable and fast as demonstrated in the following screenshot:

 

image

 

Having a larger number of controls with a high degree of responsiveness makes it possible to visualize different trends of the underlying data. The RadSparklines can be combined with other controls on the page, without adding much weight, or compromising the performance, as may be the case when adding the same number of fully functional chart controls.

 

A "Live Data" example will be live soon, demonstrating one aspect of the performance capabilities of the Sparkline controls. We hope the controls meet your application demands well and will be happy to receive any feedback!


Yavor Ivanov
About the Author

Yavor Ivanov

Yavor is a Senior Software Developer on the Telerik UI for Xamarin team. His 10+ years of XAML and WPF experience were gained in the Telerik UI for WPF and Silverlight suite as well as many LoB applications. His workday is a mixed bag of Xamarin, WPF and Angular development. Finding the right solution for the job is his main goal. You can find him on GitHub.

Comments

Comments are disabled in preview mode.