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

Aggregating data and viewing with a chart

1 Answer 79 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
olepadre
Top achievements
Rank 1
olepadre asked on 27 Mar 2015, 07:06 PM
I really want to try and use Rad HTML Chart for this, instead of just returning text.  it is a page to display Survey Responses.  Each response is a Likert Scale 1-4. I  need to display the averages of 7 questions in a single chart (because they are grouped similar questions)  Here's the problem.  Each question does have a "N/A" option which stores a NULL value in SQL so they are not calculated in the AVG or COUNT functions.

Question 1: 14 Responses, with a 3.75 AVG
Question 2: 12 Responses, with a 3.67 AVG
Question 3: 14 Responses, with a 2.00 AVG
Question 4: 13 Responses, with a 3.75 AVG
Question 5: 10 Responses, with a 2.00 AVG
etc.

I would like a single bar chart with each question a Column, showing the AVG, and the X-Axis label showing the # of responses per question that way we can justify the difference in number of responses.

Does that all make sense?

And here's my  problem; I don't know who to return the rows from SQL.  Do I return multiple rows and let ASP.NET do the AVERAGE and COUNT functions?  or do I make SQL do the calculations and only return 1 row with Col 1 = Question #1 COUNT, Col2 = Question #1 AVG, Col3 = Question #2 COUNT, Col4, Question #2 AVG, etc.

Or do I return 2 datasets, one with AVG and one with COUNT?

PLEASE HELP


1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 01 Apr 2015, 11:25 AM
Hello Robert,

In order to bind the chart each series as well as the x-axis labels should refer to the corresponding field from the data source. In your case you need two fields - one with responses for the x-axis and the other with average for the bar series.

You can examine the data binding demos for more information on the matter.

On a side note - the chart can only be bound to a single data source. You may also find useful this code library regarding manual data source grouping - http://www.telerik.com/support/code-library/group-radhtmlchart-data-source

Regards,
Danail Vasilev
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Chart (HTML5)
Asked by
olepadre
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or