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

Drill-Down - More than one DataSeries

2 Answers 44 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Nuno
Top achievements
Rank 1
Nuno asked on 09 Sep 2012, 06:22 PM
Hi,
I'm using Radchart with more than one DataSeries.
The problem i have is that i'm not being able to know the exact DataSeries that was clicked.
On the image, you can see an example
When i click on the first blue column i'm getting the same object i get when i click on the first red collumn.
How is it possible to distinct both columns on the ItemClick Event?


2 Answers, 1 is accepted

Sort by
0
Accepted
Petar Kirov
Telerik team
answered on 12 Sep 2012, 04:22 PM
Hi Nuno ,

The event handler for the ItemClick has ChartItemClickEventArgs which can give you information about the exact data point you have clicked and DataSeries to which the data point belongs.

You could check if the data series of the data point are the same as those at index x in radChart.DefaultView.ChartArea.DataSeries collection. Like this: 
if (e.DataPoint.DataSeries == this.radChart.DefaultView.ChartArea.DataSeries[0])
{
    //...
}
else
{
    //...
}

Or if that is not enough (or you are using item mappings) you could set each data series a different LegendLabel and distinguish the data series by it:
if (e.DataPoint.DataSeries.LegendLabel == "Series 1")
{
}
else if (...)
{
}

I hope this helps.
 
Regards,
Petar Kirov
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Nuno
Top achievements
Rank 1
answered on 13 Sep 2012, 08:23 AM
Thanks Petar,
The first solution solved my problem.
Tags
Chart
Asked by
Nuno
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Nuno
Top achievements
Rank 1
Share this question
or