1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-03-02 03:40:21 +00:00

resolves #62: add average line to build time graphs

This commit is contained in:
Oliver Giles
2018-09-08 21:02:58 +03:00
parent 010af57ed4
commit a2d30ad2ea
2 changed files with 28 additions and 2 deletions

View File

@@ -501,6 +501,16 @@ var Job = function() {
return '#' + e.number;
}).reverse(),
datasets: [{
label: 'Average',
type: 'line',
data: [{x:0,y:msg.averageRuntime},{x:1,y:msg.averageRuntime}],
borderColor: 'steelblue',
backgroundColor: 'transparent',
xAxisID: 'avg',
pointRadius: 0,
pointHitRadius: 0,
pointHoverRadius: 0,
},{
label: 'Build time',
backgroundColor: (new Array(msg.recent.length)).fill('darkseagreen'),
borderColor: (new Array(msg.recent.length)).fill('forestgreen'),
@@ -508,6 +518,21 @@ var Job = function() {
return e.completed - e.started;
}).reverse()
}]
},
options: {
scales:{
xAxes:[{},{
id: 'avg',
type: 'linear',
ticks: {
display: false
},
gridLines: {
display: false,
drawBorder: false
}
}]
}
}
});