Browse Source

Remove 'Answer Rate' chart if no moments have been sent yet in results page

Victor Hernandez 4 years ago
parent
commit
8ad7340f6a
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      respuestas.php

+ 7
- 1
respuestas.php View File

114
 	
114
 	
115
 		<div class="container" style="margin-top: 8rem;">
115
 		<div class="container" style="margin-top: 8rem;">
116
 		
116
 		
117
-			<!-- CHART -->
117
+			<!-- TITLE + EXPORT RAW -->
118
 			<div class="row">
118
 			<div class="row">
119
 				<div class="col-sm-10">
119
 				<div class="col-sm-10">
120
 					<h2>
120
 					<h2>
355
 			let momentIDToNumber = {};
355
 			let momentIDToNumber = {};
356
 			let number = 1; // start at 1
356
 			let number = 1; // start at 1
357
 			
357
 			
358
+			// If no moments have been sent yet, remove chart
359
+			if(dataSet === null) {
360
+				document.getElementById('myChart2').remove();
361
+				return;
362
+			}
363
+			
358
 			// Fill Data Containers
364
 			// Fill Data Containers
359
 			dataSet.forEach(function(point) {
365
 			dataSet.forEach(function(point) {
360
 			
366