I'm displaying a bar chart, the chart is grouped by date and a string value (Yes, No, NA). I need to show the percentage of each string value for each date, is this possible via the chart?
Can this be achieved by using a custom aggregate function? If so, could i possible see an example of how to create and implement a custom aggregate function.
Can this be achieved by using a custom aggregate function? If so, could i possible see an example of how to create and implement a custom aggregate function.
4 Answers, 1 is accepted
0
Hello Paul,
Can you please show us a sample of the data and an example of the expected chart? Thanks.
Best regards,
Ves
the Telerik team
Can you please show us a sample of the data and an example of the expected chart? Thanks.
Best regards,
Ves
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
0
Paul
Top achievements
Rank 1
answered on 16 Sep 2011, 02:17 PM
For example we will have an object like below:
And our data is something similar like below:
We would like to group by admission date, result and hospital or ward and calculate the percentage of each result (Yes, No, N/A) for each hospital/ward for the admission date. We would like to display this as a bar chart with percentage as the Y Axis and Admission Date as the X Axis.
Public Class ChartData
Public Result as string
Public HospitalName as string
Public WardName as string
Public AdmissionDate as date
End Class
And our data is something similar like below:
Result, Hospital Name, Ward Name, Admission Date
Yes, Hosp One, ACU, 01-01-2011
Yes, Hosp One, ACU, 01-01-2011
No, Hosp One, DRU, 01-01-2011
Yes, Hosp One, DRU, 01-01-2011
N/A, Hosp Two, MUU, 02-01-2011
Yes, Hosp Two, MUU, 02-01-2011
We would like to group by admission date, result and hospital or ward and calculate the percentage of each result (Yes, No, N/A) for each hospital/ward for the admission date. We would like to display this as a bar chart with percentage as the Y Axis and Admission Date as the X Axis.
0
Hi Paul,
Please, find attached a small example. It uses Grouping and DateTime grouping, along with StackedBar100 series, which is the most appropriate when you need to display contribution in percentage on multiple instances.
Kind regards,
Ves
the Telerik team
Please, find attached a small example. It uses Grouping and DateTime grouping, along with StackedBar100 series, which is the most appropriate when you need to display contribution in percentage on multiple instances.
Kind regards,
Ves
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Hi Paul,
Just a quick follow-up. The previous example is in C#, you can find a VB version attached to this message.
Best regards,
Ves
the Telerik team
Just a quick follow-up. The previous example is in C#, you can find a VB version attached to this message.
Best regards,
Ves
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>