changed export sheet title and also fixed issue in chart rendering in result page
This commit is contained in:
		
							parent
							
								
									5de4fd7777
								
							
						
					
					
						commit
						2c9c57287f
					
				|  | @ -1,7 +1,7 @@ | |||
| # encoding: utf-8 | ||||
| 
 | ||||
| wb = xlsx_package.workbook | ||||
| wb.add_worksheet(name: @survey.title) do |sheet| | ||||
| wb.add_worksheet(name: @survey.title[0..15]) do |sheet| | ||||
| 
 | ||||
|   row = [] | ||||
|   @survey_questions.each_with_index do |question, i| | ||||
|  |  | |||
|  | @ -25,9 +25,9 @@ | |||
|                 <div id="question_chart_<%= question.id.to_s %>" style="width: 600px; height: 300px;"></div> | ||||
|               </li> | ||||
|             <% when SurveyQuestion::Radiogroup %> | ||||
|               <% question.survey_question_options.each do |option| %> | ||||
|               <% question.survey_question_options.each_with_index do |option,index| %> | ||||
|                 <li> | ||||
|                   <div id="question_chart_<%= question.id.to_s %>_<%= option.id.to_s %>" style="width: 600px; height: 300px;"></div> | ||||
|                   <div id="question_chart_<%= question.id.to_s %>_<%= index.to_s %>" style="width: 600px; height: 300px;"></div> | ||||
|                 </li> | ||||
|               <% end %> | ||||
|             <% end %> | ||||
|  | @ -57,15 +57,17 @@ | |||
|           chart_<%= qid %>.draw(data_<%= qid %>, {title: '<%= question.title %>'}); | ||||
|         <% when ::SurveyQuestion::Radiogroup %> | ||||
|           <% options = Hash[question.survey_question_options.collect{|o| [ o.id.to_s, o.name ] }] %> | ||||
|           <% i = 0 %> | ||||
|           <% @chart_data[qid].each do |option, groups| %> | ||||
|             var data_<%= qid %>_<%= option %> = google.visualization.arrayToDataTable([ | ||||
|             var data_<%= qid %> = google.visualization.arrayToDataTable([ | ||||
|               ['<%= t("survey_question.option") %>', ''], | ||||
|               <% groups.each do |group, count| %> | ||||
|                 ['<%= group %>', <%= count %>], | ||||
|               <% end %> | ||||
|             ]); | ||||
|             var chart_<%= qid %>_<%= option %> = new google.visualization.PieChart(document.getElementById('question_chart_<%= qid %>_<%= option %>')); | ||||
|           chart_<%= qid %>_<%= option %>.draw(data_<%= qid %>_<%= option %>, {title: '<%= question.title %> - <%= options[option] %>'}); | ||||
|             var chart_xx = new google.visualization.PieChart(document.getElementById('question_chart_<%= qid %>_<%= i.to_s %>')); | ||||
|           chart_xx.draw(data_<%= qid %>, {title: '<%= question.title %> - <%= options[option] %>'}); | ||||
|             <% i = i + 1 %> | ||||
|           <% end %> | ||||
|         <% end %> | ||||
|       <% end %> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue