Move analytic logic to separate classes

This commit is contained in:
Frederic Guillot
2016-01-15 21:03:19 -05:00
parent 1bbd4faf56
commit c58478c0ab
13 changed files with 424 additions and 134 deletions

View File

@@ -4,14 +4,16 @@ function CompareHoursColumnChart(app) {
CompareHoursColumnChart.prototype.execute = function() {
var metrics = $("#chart").data("metrics");
var labelOpen = $("#chart").data("label-open");
var labelClosed = $("#chart").data("label-closed");
var spent = [$("#chart").data("label-spent")];
var estimated = [$("#chart").data("label-estimated")];
var categories = [];
for (var status in metrics) {
spent.push(parseInt(metrics[status].time_spent));
estimated.push(parseInt(metrics[status].time_estimated));
categories.push(status);
spent.push(parseFloat(metrics[status].time_spent));
estimated.push(parseFloat(metrics[status].time_estimated));
categories.push(status == 'open' ? labelOpen : labelClosed);
}
c3.generate({