Add new analytic component "Estimated vs actual time per column"
This commit is contained in:
committed by
GitHub
parent
6cadf82a63
commit
a267aa368b
@@ -0,0 +1,37 @@
|
||||
KB.component('chart-project-estimated-actual-column', function (containerElement, options) {
|
||||
|
||||
this.render = function () {
|
||||
var spent = [options.labelSpent];
|
||||
var estimated = [options.labelEstimated];
|
||||
var columns = [];
|
||||
|
||||
for (var column in options.metrics) {
|
||||
spent.push(options.metrics[column].hours_spent);
|
||||
estimated.push(options.metrics[column].hours_estimated);
|
||||
columns.push(options.metrics[column].title);
|
||||
}
|
||||
|
||||
KB.dom(containerElement).add(KB.dom('div').attr('id', 'chart').build());
|
||||
|
||||
c3.generate({
|
||||
data: {
|
||||
columns: [spent, estimated],
|
||||
type: 'bar'
|
||||
},
|
||||
bar: {
|
||||
width: {
|
||||
ratio: 0.2
|
||||
}
|
||||
},
|
||||
axis: {
|
||||
x: {
|
||||
type: 'category',
|
||||
categories: columns
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: true
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user