Data Visualization is a very hot topic today!
People simply don’t have time to read long and boring sheets of data and would rather have this data chewed for them in the form of nice graphs.
As you can see, we are plotting a very large data set over a very small area and everything looks cramped up. What if we were able to select a specific portion of the chart and get a zoomed in view on that period?
With this in mind I am happy to introduce to you, RadRangeSelector for WinForms. Now, let’s dive deeper in what this control is capable of and how you get it working for you.
What is RadRangeSelector?
Supposing that you already have a RadChart filled with data, you can easily make RadRangeSelector to start displaying that data by setting its AssociatedControl property to the RadChartView instance:
As you can see from the output, the whole data is plotted in RadRangeSelector and we get the guides to select a percentage of the data. Once the guides are set, RadRangeSelector will colalborate with RadChartView to show only the selected data points instead of all of them. That’s all there is to using the RadRangeSelector.
From there on, you have plenty of options to customize RadRangeSelector behavior and appearance. The end-user also has a deal of pulls and lever to work with in order to get the best view of his data.
Let’s take a look at the end-user functionality and then check how we can modify it.
Main preview window
RadRangeSelector allows the end user to increase or decrease the amount of data that would be displayed by RadChartView in its viewport. This is possible thanks to the two handles on the left and right sides of preview window in RadRangeSelector. In other words, this means that the user can now change the zoom factor of the data displayed in RadChartView.
.radRangeSelector1.StartRange = 0;
.radRangeSelector1.EndRange = 50;
which will result in this:
sender, ScaleInitializingEventArgs e)
RangeSelectorChartScaleContainerElement chartScaleElement = e.ScaleElement
chartScaleElement.LabelsOffset = 0;
RangeSelectorViewElement chartElement =
sender, LabelInitializingEventArgs e)
: e.LabelElement.ForeColor = Color.Blue;
: e.LabelElement.ForeColor = Color.Green;
: e.LabelElement.ForeColor = Color.Red;
: e.LabelElement.ForeColor = Color.Orange;
Or, if you don’t need these handler, you can hide them by setting the ShowButtons property to false:
sender, SeriesInitializingEventArgs e)
As you see, using RadRangeSelector is no sweat and can be done with minimal coding. Hope you are excited to try out this control in UI for Windows Forms suite. Do download a trial and get started.
Lohith Goudagere Nagaraj is a Microsoft MVP in ASP.NET and a Developer Evangelist for Telerik in India. He has a decade of experience building web applications and is well versed with the Web Forms and MVC models of web development. You can get more information from Lohith on Twitter by following @kashyapa.Google Profile
Subscribe to be the first to get our expert-written articles and tutorials for developers!