aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/js/dashboard.js27
1 files changed, 16 insertions, 11 deletions
diff --git a/web/js/dashboard.js b/web/js/dashboard.js
index 318e64c76..848fb0c2e 100644
--- a/web/js/dashboard.js
+++ b/web/js/dashboard.js
@@ -139,21 +139,26 @@ $(function(){
data0 = $allReports.data('values-reports'),
data1 = $allReports.data('values-fixed');
- window.chartAllReports = new Chart($allReports, {
- type: 'line',
- data: {
- labels: labels,
- datasets: [{
- data: data0,
- pointRadius: pointRadiusFinalDot(data0.length, 4),
- pointBackgroundColor: colours[1],
- borderColor: colours[1]
- }, {
+ var data = [{
+ data: data0,
+ pointRadius: pointRadiusFinalDot(data0.length, 4),
+ pointBackgroundColor: colours[1],
+ borderColor: colours[1]
+ }];
+ if ( data1 ) {
+ data.push({
data: data1,
pointRadius: pointRadiusFinalDot(data1.length, 4),
pointBackgroundColor: colours[3],
borderColor: colours[3]
- }]
+ });
+ }
+
+ window.chartAllReports = new Chart($allReports, {
+ type: 'line',
+ data: {
+ labels: labels,
+ datasets: data
},
options: {
animation: {