Adefinir  1
chart.blade.php
Go to the documentation of this file.
1 @extends( "layouts.chart_page" )
2 @section('title','Résultats')git
3 <?php
4 $results = $game->getResultsArray();
5 //$results = $_SESSION['resultsArrays'];
6 ?>
7 @section('main')
8 
9 
10 <div id="container" style="width: 75%;">
11 <canvas id="myChart" width="400" height="400"></canvas>
12 </div>
13 <script> alert('test')</script>
14 <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
15 <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js"></script>
16 <script>
17 var ctx = document.getElementById("myChart");
18 var myChart = new Chart(ctx, {
19  type: 'bar',
20  data: {
21  labels: ["Affordance", "Bugs", "Design", "Difficulté", "Contenu éducatif", "Concentration du joueur","Interactivité","Jouabilité","Etudes marketing","Scénario","Environnement sonore"],
22  datasets: [{
23  label: 'Score',
24  data: [<?php echo (json_encode($results['affordance'], JSON_HEX_TAG)); ?>, <?php echo (json_encode($results['bugs'], JSON_HEX_TAG)); ?>, <?php echo (json_encode($results['design'], JSON_HEX_TAG)); ?>, <?php echo (json_encode($results['difficulty'], JSON_HEX_TAG)); ?>, <?php echo (json_encode($results['educationalContent'], JSON_HEX_TAG)); ?>, <?php echo (json_encode($results['focus'], JSON_HEX_TAG)); ?>, <?php echo (json_encode($results['interactivity'], JSON_HEX_TAG)); ?>,<?php echo (json_encode($results['playability'], JSON_HEX_TAG)); ?>,<?php echo (json_encode($results['research'], JSON_HEX_TAG)); ?>, <?php echo (json_encode($results['scenario'], JSON_HEX_TAG)); ?>,<?php echo (json_encode($results['soundscape'], JSON_HEX_TAG)); ?>],
25  backgroundColor: [
26  'rgba(255, 99, 132, 0.2)',
27  'rgba(54, 162, 235, 0.2)',
28  'rgba(255, 206, 86, 0.2)',
29  'rgba(75, 192, 192, 0.2)',
30  'rgba(153, 102, 255, 0.2)',
31  'rgba(255, 99, 132, 0.2)',
32  'rgba(255, 99, 132, 0.2)',
33  'rgba(255, 99, 132, 0.2)',
34  'rgba(255, 99, 132, 0.2)',
35  'rgba(255, 99, 132, 0.2)',
36  'rgba(255, 159, 64, 0.2)'
37  ],
38  borderColor: [
39  'rgba(255,99,132,1)',
40  'rgba(54, 162, 235, 1)',
41  'rgba(255, 206, 86, 1)',
42  'rgba(75, 192, 192, 1)',
43  'rgba(153, 102, 255, 1)',
44  'rgba(255,99,132,1)',
45  'rgba(255,99,132,1)',
46  'rgba(255,99,132,1)',
47  'rgba(255,99,132,1)',
48  'rgba(255,99,132,1)',
49  'rgba(255, 159, 64, 1)'
50  ],
51  borderWidth: 1
52  }]
53  },
54  options: {
55  scales: {
56  yAxes: [{
57  ticks: {
58  beginAtZero:true
59  }
60  }]
61  }
62  }
63 });
64 </script>
65 @endsection
$results
$results
Definition: chart.blade.php:4