As Q2 2011 is officially out, we are really excited about all the interactivity features we shipped with our charting component. Together with all the built-in goodies like PanAndZoom, Trackball and Tooltip, we have also implemented a flexible and convenient way for extending the default gesture handling behavior of RadChart. By implementing a handler for the RadChart.PreviewGesture event you may provide completely custom interactivity depending on your custom scenario. When marked as “Handled” the event will have higher priority than any default behaviors registered with the Chart.
Let’s play a bit more with the PreviewGesture event by implementing a very simple drill-down scenario that changes the data source of the chart when clicked on a Bar item.
The XAML is minimal – we have a Cartesian chart with one Bar series and a handler for the PreviewGesture event:
And the handler looks like:
Gotcha: The ChartGestureEventArgs.PrimaryLocation property is not properly translated to chart coordinates, so do not use it until our next internal build :)
Now let's handle the Hold gesture and perform a scale animation upon the chart:
Pretty easy, right? We have further plans of extending the chart interactivity with selection, visual filtering and probably annotations, so stay tuned for future releases :)
Attached is the sample project, you will just need to add the Telerik references to it. Enjoy!
Georgi has 15 years of experience in multiple software technologies. Ten years ago, he joined Telerik, later acquired by Progress, and he has set up and led multiple products and teams since. His latest endeavor is building a product that adds the Progress value into the augmented and virtual reality development workflow.
Subscribe to be the first to get our expert-written articles and tutorials for developers!