Adefinir  Finale
chart.blade.php
Go to the documentation of this file.
1 @extends( "layouts.chart_page" )
2 @section('title','Résultats')
3 <?php
4 $results = $game->getResultsArray();
5 ?>
6 @section('main')
7 
8 
9 <div id="container" style="width: 75%;">
10 <canvas id="myChart" width="1000" height="400"></canvas>
11 </div>
12 <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
13 <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js"></script>
14 <script>
15 var ctx = document.getElementById("myChart");
16 var myChart = new Chart(ctx, {
17  type: 'bar',
18  data: {
19  labels: [
20  "Possibilités d'actions", "Bugs corrigés",
21  "Design", "Difficulté",
22  "Contenu éducatif", "Concentration du joueur",
23  "Interactivité","Jouabilité",
24  "Etudes marketing","Scénario",
25  "Environnement sonore" ],
26  datasets: [{
27  label: 'Score',
28  data: [
29  <?php echo (json_encode($results['affordance'], JSON_HEX_TAG)); ?>,
30  <?php echo (json_encode($results['bugs'], JSON_HEX_TAG)); ?>,
31  <?php echo (json_encode($results['design'], JSON_HEX_TAG)); ?>,
32  <?php echo (json_encode($results['difficulty'], JSON_HEX_TAG)); ?>,
33  <?php echo (json_encode($results['educationalContent'], JSON_HEX_TAG)); ?>,
34  <?php echo (json_encode($results['focus'], JSON_HEX_TAG)); ?>,
35  <?php echo (json_encode($results['interactivity'], JSON_HEX_TAG)); ?>,
36  <?php echo (json_encode($results['playability'], JSON_HEX_TAG)); ?>,
37  <?php echo (json_encode($results['research'], JSON_HEX_TAG)); ?>,
38  <?php echo (json_encode($results['scenario'], JSON_HEX_TAG)); ?>,
39  <?php echo (json_encode($results['soundscape'], JSON_HEX_TAG)); ?> ],
40  backgroundColor: [
41  'rgba(240, 173, 78, 0.2)',
42  'rgba(240, 173, 78, 0.2)',
43  'rgba(240, 173, 78, 0.2)',
44  'rgba(240, 173, 78, 0.2)',
45  'rgba(240, 173, 78, 0.2)',
46  'rgba(240, 173, 78, 0.2)',
47  'rgba(240, 173, 78, 0.2)',
48  'rgba(240, 173, 78, 0.2)',
49  'rgba(240, 173, 78, 0.2)',
50  'rgba(240, 173, 78, 0.2)',
51  'rgba(240, 173, 78, 0.2)'
52  ],
53  borderColor: [
54  'rgba(240, 173, 78, 1)',
55  'rgba(240, 173, 78, 1)',
56  'rgba(240, 173, 78, 1)',
57  'rgba(240, 173, 78, 1)',
58  'rgba(240, 173, 78, 1)',
59  'rgba(240, 173, 78, 1)',
60  'rgba(240, 173, 78, 1)',
61  'rgba(240, 173, 78, 1)',
62  'rgba(240, 173, 78, 1)',
63  'rgba(240, 173, 78, 1)',
64  'rgba(240, 173, 78, 1)'
65  ],
66  borderWidth: 1
67  }]
68  },
69  options: {
70  legend: {
71  labels: {
72  fontColor:"white",
73  }
74  },
75  responsive: true,
76  maintainAspectRatio: false,
77  scales: {
78  yAxes: [{
79  ticks: {
80  fontColor: "white",
81  beginAtZero:true,
82  stepSize:1,
83  }
84  }],
85  xAxes: [{
86  ticks: {
87  fontColor: "white",
88  beginAtZero:true,
89  stepSize:1,
90  }
91  }]
92  }
93  }
94 });
95 </script>
96 @endsection
$game
$game
Definition: results.blade.php:7
$results
$results
Definition: chart.blade.php:4