Enhancements in proposal progress graph

x axis legend now show less labels in order to improve its readability.
This commit is contained in:
Juan Salvador Pérez García
2018-09-14 16:28:20 +02:00
parent 7143e10201
commit 826ce8af25

View File

@@ -179,10 +179,8 @@
x: {
type: 'category',
tick: {
fit: true,
culling: {
max: 15
}
values: this.tickXValues(),
centered: true
}
}
},
@@ -212,6 +210,23 @@
return tick;
};
ProposalGraph.prototype.tickXValues = function () {
var i,
l,
tick = [],
step = this.xColumnValues.length < 13 ? 12 : Math.round((this.xColumnValues.length - 1) / 12);
if (this.xColumnValues.length > 1) {
tick.push(0);
for(i = step, l = this.xColumnValues.length - 1; i < l; i += step) {
tick.push(i);
}
}
return tick;
};
ProposalGraph.prototype.formatXColumnValues = function () {
var i, l, parts;