Skip to content

Commit

Permalink
Fixed issue: simple stats wasn't loading all graphs when too many que…
Browse files Browse the repository at this point in the history
…stions
  • Loading branch information
LouisGac committed Apr 28, 2016
1 parent 6a0c9a7 commit a59e860
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 34 deletions.
Expand Up @@ -13,6 +13,7 @@
*
*/
?>
<!-- _statisticsoutput_graphs -->
<?php if(count($labels) < 70): ?>
<!-- Charts -->
<div class="row">
Expand Down Expand Up @@ -66,3 +67,4 @@
var labels_<?php echo $qqid; ?>=<?php echo json_encode($labels); // the array of labels ?>;
var grawdata_<?php echo $qqid;?>=<?php echo json_encode($grawdata); // the datas to generate the graph ?>;
</script>
<!-- endof _statisticsoutput_graphs -->
Expand Up @@ -8,36 +8,7 @@
*/
?>


<!-- _statisticsoutput_header -->
<div class="col-sm-4" style="margin-top: 2em;margin-bottom: 2em;">
<h4><?php echo $outputs['qtitle'];?></h4>
<?php /*
<table class='statisticstable table table-bordered'>
<thead>
<tr>
<?php if($bAnswer): ?>
<th width='' align='center' >
<strong>
<?php eT("Answer");?>
</strong>
</th>
<?php endif; ?>
<th width='' align='center' >
<strong><?php eT("Count"); ?></strong>
</th>
<th width='' align='center' >
<strong><?php eT("Percentage");?></strong>
</th>
<?php if($bSum): ?>
<th width='' align='center' >
<strong>
<?php eT("Sum");?>
</strong>
</th>
<?php endif; ?>
</tr>
</thead>
*/?>
<h4><?php echo $outputs['qquestion'];?></h4>
<!-- end of _statisticsoutput_header -->
4 changes: 2 additions & 2 deletions scripts/admin/statistics.js
Expand Up @@ -108,7 +108,7 @@ function init_chart_js_graph_with_datasets($type,$qid)
window.chartjs[$qid].destroy();
}
}

window.chartjs[$qid] = new Chart($canvas)[$type]({
labels: $labels,
datasets: [{
Expand Down Expand Up @@ -178,7 +178,7 @@ $(document).ready(function() {

if($('#showGraphOnPageLoad').length>0)
{
$('.chartjs-container').loadGraph();
$('#statisticsoutput .row').first().find('.chartjs-container').loadGraph();
}

$('#generalfilters-chevron').click(function(){
Expand Down

0 comments on commit a59e860

Please sign in to comment.