Commit 7ee95995 authored by Jérome Perrin's avatar Jérome Perrin

Also output average daily attainment

parent d1181d2b
......@@ -496,20 +496,23 @@
var text = exit_stat.html() + "<br/><b>" + (el.name || el.id) + "</b><br/>";
$.each(el.results, function(metric, value){
if (metric == 'intervalThroughputList') {
var general = that.getData().general,
throughputTarget = parseFloat(general.throughputTarget),
desiredPercentageOfSuccess = parseFloat(general.desiredPercentageOfSuccess);
text += "<em>Daily Attainment</em>: "
var attainment_list = [],
general = that.getData().general,
throughputTarget = parseFloat(general.throughputTarget),
desiredPercentageOfSuccess = parseFloat(general.desiredPercentageOfSuccess);
text += "<em>Daily Attainment:</em> "
$.each(value, function(i, intervalValue) {
var icon = "fa-frown-o";
attainment_list.push((intervalValue/throughputTarget));
if ((intervalValue/throughputTarget) > desiredPercentageOfSuccess) {
icon = "fa-smile-o"
}
text += intervalValue + '<i class="fa ' + icon + '"/> ';
})
text += "<br/>";
text += "<br/><em>Average Daily Line Attainment</em>: " + (
(attainment_list.reduce(function(a, b){return a+b}) / attainment_list.length ) * 100).toFixed(2) + "%<br/>";
} else {
text += "<em>" + metric + "</em>: " + value + "<br/>";
text += "<em>" + metric + ":</em> " + value + "<br/>";
}
})
exit_stat.html(text);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment