Enhacements in proposal progress graph

Proposed action execution is shown with a red dot. Mouse hover event
shows a pop up for the points of the graph. Red dots will contain the
proposed acction executed for the given date.
This commit is contained in:
Juan Salvador Pérez García
2018-10-01 11:22:32 +02:00
parent 92c0e34c7a
commit 2dc39e1498

View File

@@ -165,7 +165,24 @@
this.progressColumnValues, this.progressColumnValues,
this.successfulColumnValues this.successfulColumnValues
], ],
colors: colors colors: colors,
color: function (color, d) {
var achievement;
if (d.id === this.successfulColumnValues[0] || !d.hasOwnProperty('x')) {
return color;
}
achievement = this.achievements.find(function (element) {
return element.value === this.xColumnValues[d.index + 1];
}.bind(this));
if (achievement !== undefined) {
return '#ff0000';
}
return color;
}.bind(this)
}, },
axis: { axis: {
y: { y: {
@@ -190,13 +207,25 @@
grid: { grid: {
y: { y: {
lines: this.goals lines: this.goals
},
x: {
lines: this.achievements
} }
}, },
zoom: { zoom: {
enabled: true enabled: true
},
tooltip: {
format: {
title: function (d) {
var achievement = this.achievements.find(function (element) {
return element.value === this.xColumnValues[d + 1];
}.bind(this));
if (achievement !== undefined) {
return this.xColumnValues[d + 1] + ': ' + achievement.text;
}
return this.xColumnValues[d + 1];
}.bind(this)
}
} }
}); });
}; };