Hi All,
Any Idea to dig More information on RadCartesianChart control. I have attached a sample graph(sampleBarGraphs.jpeg) snap for reference. As you can see in the snap it is a bar graph which different Activities like planned-131,completed-45 etc. So when I click on Planned Activity in the bar I need to dig more information on it like a pop up which displayed some rad list items the count of these list is the Planned activity count in the bar graph.
Any samples solutions or documentation for reference to implement the sample graph using telerik controls/behavior's.
Thanks in Advance.
6 Answers, 1 is accepted
Hello Kishorekumar,
The sample graph can be created using RadCartesianChart with LinearAxis (vertical) and DateTimeCategoricalAxis (horizontal). The bars can be achieved with four BarSeries with CombineMode set to Stack. As for the dig information, there are a couple of approaches to achieve such visualization:
- You can use the built-in trackball or tooltip behaviors. They show the information you need, but on mouse move over the chart, instead of on click. This will be the most straightforward approach that you can use.
- Or you can manually implement the popup (or whatever information panel you require) and then open it on MouseLeftButtonDown over the chart. To get the data point under the mouse, you can iterate the DataPoints collections of all series in the chart and check if the mouse position is inside the LayoutSlot of any data point. If so, open the popup and display information about the clicked data point. For example:Alternatively to the MouseLeftButtonDown event, you can use the chart's selection behavior and its SelectionChanged event in order to indicate a data point click. This approach is shown in the DrillDown SDK sample.
private void RadCartesianChart_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { var chart = (RadCartesianChart)sender; var mousePosition = e.GetPosition(chart); foreach (BarSeries series in chart.Series) { foreach (CategoricalDataPoint dp in series.DataPoints) { if (dp.LayoutSlot.Contains(mousePosition.X, mousePosition.Y)) { // show a Popup with information from the "dp" variable // note that if you use the ItemsSource you can get the data item behind the data point via the DataItem property // dp.DataItem } } } }
I hope this information helps.
Regards,
Martin Ivanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi Martin Ivanov,
Can you provide any sample solutions(for the Graph Attached(sampleBarGraphs.jpeg)) of required behavior like there will be bar graph with RadCartesianChart Control when MouseLeftButtonDown Event is Fired then a pop up with radListBox Control where the data will be in ListboxItem.
Regards,
KishoreKumar
If Possible Upon Hover on the bar Series The Counts data has to be displayed on ChartTrackBallBehavior.
Thanks in advance!!!
Hello KishoreKumar,
I've attached two projects. One showing an approach with the trackball and another one with bar click approach. I hope this helps.
Regards,
Martin Ivanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.