3 Answers, 1 is accepted
0
Rahul
Top achievements
Rank 2
answered on 26 Jan 2012, 09:04 PM
Hi John,
This is my sample code for selecting values from chart Data Points
Hope it will help you.
Regards
Rahul
This is my sample code for selecting values from chart Data Points
radChart.DefaultView.ChartArea.ItemClick +=
new
EventHandler<ChartItemClickEventArgs>(ChartArea_ItemClick);
void
ChartArea_ItemClick(
object
sender, ChartItemClickEventArgs e)
{
int
diseaseID = Convert.ToInt32(((AnalyticsReports.ReportServiceReference.CareProviderDisease)(e.DataPoint.DataItem)).DiseaseId);
DiseaseIDGlobal = diseaseID;
int
isPrograms = 1;
string
measureRange = e.DataPoint.LegendLabel.ToString();
switch
(e.DataPoint.LegendLabel.ToString())
{
case
"Good"
:
txtDiseaseDrillDown.Text =
"[Disease Name- "
+ Convert.ToString(((AnalyticsReports.ReportServiceReference.CareProviderDisease)(e.DataPoint.DataItem)).DiseaseFullName) +
"] - [Measure - "
+ e.DataPoint.LegendLabel.ToString() +
"] - [# of Pts : "
+ Convert.ToString(((AnalyticsReports.ReportServiceReference.CareProviderDisease)(e.DataPoint.DataItem)).Good) +
"]"
;
break
;
case
"Fair"
:
txtDiseaseDrillDown.Text =
"[Disease Name- "
+ Convert.ToString(((AnalyticsReports.ReportServiceReference.CareProviderDisease)(e.DataPoint.DataItem)).DiseaseFullName) +
"] - [Measure - "
+ e.DataPoint.LegendLabel.ToString() +
" - [# of Pts : "
+ Convert.ToString(((AnalyticsReports.ReportServiceReference.CareProviderDisease)(e.DataPoint.DataItem)).Fair) +
"]"
;
break
;
case
"Poor"
:
txtDiseaseDrillDown.Text =
"[Disease Name- "
+ Convert.ToString(((AnalyticsReports.ReportServiceReference.CareProviderDisease)(e.DataPoint.DataItem)).DiseaseFullName) +
"] - [Measure - "
+ e.DataPoint.LegendLabel.ToString() +
"] - [# of Pts : "
+ Convert.ToString(((AnalyticsReports.ReportServiceReference.CareProviderDisease)(e.DataPoint.DataItem)).Poor) +
"]"
;
break
;
case
"Undefined"
:
txtDiseaseDrillDown.Text =
"[Disease Name- "
+ Convert.ToString(((AnalyticsReports.ReportServiceReference.CareProviderDisease)(e.DataPoint.DataItem)).DiseaseFullName) +
"] - [Measure - "
+ e.DataPoint.LegendLabel.ToString() +
"] - [# of Pts : "
+ Convert.ToString(((AnalyticsReports.ReportServiceReference.CareProviderDisease)(e.DataPoint.DataItem)).UnDefined) +
"]"
;
break
;
}
}
Hope it will help you.
Regards
Rahul
0
Accepted
Hello John,
Tsvetie
the Telerik team
For additional details and code sample, please refer to this blog post. The solution that it describes is actually very similar to the one that Rahul suggested.
Kind regards,Tsvetie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
John
Top achievements
Rank 1
answered on 27 Jan 2012, 03:00 PM
This is a fantastic solution. Thank you so much for finding this post for me! It absolutely works like a charm.