Minor - change radar UI #3644

pull/3673/head
Julio Montoya 5 years ago
parent 6a1fbc4eea
commit 784e193807
  1. 13
      main/exercise/exercise.class.php

@ -10515,8 +10515,8 @@ class Exercise
// Default preset, after that colors are generated randomly. @todo improve colors. Use a js lib? // Default preset, after that colors are generated randomly. @todo improve colors. Use a js lib?
$colorList = [ $colorList = [
'rgb(255, 99, 132, 1.0)',
'rgb(0,0,200,1.0)', // red 'rgb(0,0,200,1.0)', // red
'rgb(255, 99, 132, 1.0)', // blue
'rgb(255, 159, 64, 1.0)', // orange 'rgb(255, 159, 64, 1.0)', // orange
'rgb(255, 205, 86, 1.0)', //yellow 'rgb(255, 205, 86, 1.0)', //yellow
'rgb(75, 192, 192, 1.0)', // green 'rgb(75, 192, 192, 1.0)', // green
@ -10550,13 +10550,14 @@ class Exercise
$resultsToJson = json_encode($dataSetToJson); $resultsToJson = json_encode($dataSetToJson);
return " return "
<canvas id='categoryRadar' width='400' height='200'></canvas> <canvas id='categoryRadar' height='200'></canvas>
<script> <script>
var data = { var data = {
labels: $labels, labels: $labels,
datasets: $resultsToJson datasets: $resultsToJson
} }
var options = { var options = {
responsive: true,
scale: { scale: {
angleLines: { angleLines: {
display: false display: false
@ -10565,7 +10566,7 @@ class Exercise
beginAtZero: true, beginAtZero: true,
min: 0, min: 0,
max: 10, max: 10,
stepSize: 1 stepSize: 1,
}, },
pointLabels: { pointLabels: {
fontSize: 14, fontSize: 14,
@ -10581,7 +10582,11 @@ class Exercise
legend: { legend: {
//position: 'bottom' //position: 'bottom'
display: false display: false
} },
animation: {
animateScale: true,
animateRotate: true
},
}; };
var ctx = document.getElementById('categoryRadar').getContext('2d'); var ctx = document.getElementById('categoryRadar').getContext('2d');
var myRadarChart = new Chart(ctx, { var myRadarChart = new Chart(ctx, {

Loading…
Cancel
Save