This is a migrated thread and some comments may be shown as answers.

Dig More information on RadCartesianChart Control

6 Answers 67 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Kishorekumar
Top achievements
Rank 1
Veteran
Kishorekumar asked on 25 Dec 2020, 12:01 PM

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

Sort by
0
Kishorekumar
Top achievements
Rank 1
Veteran
answered on 25 Dec 2020, 12:01 PM
attachment of graph
0
Martin Ivanov
Telerik team
answered on 29 Dec 2020, 03:54 PM

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:
    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
    			}
    		}
    	}
    }
    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.

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/.

0
Kishorekumar
Top achievements
Rank 1
Veteran
answered on 30 Dec 2020, 06:22 AM

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

 

0
Kishorekumar
Top achievements
Rank 1
Veteran
answered on 30 Dec 2020, 10:00 AM

If Possible Upon Hover on the bar Series The Counts data has to be displayed on ChartTrackBallBehavior.

Thanks in advance!!!

0
Accepted
Martin Ivanov
Telerik team
answered on 01 Jan 2021, 02:35 PM

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/.

0
Kishorekumar
Top achievements
Rank 1
Veteran
answered on 04 Jan 2021, 09:01 AM
Thanks Martin Ivanov. Your Solution Works!!!
Tags
Chart
Asked by
Kishorekumar
Top achievements
Rank 1
Veteran
Answers by
Kishorekumar
Top achievements
Rank 1
Veteran
Martin Ivanov
Telerik team
Share this question
or