Merge pull request #232 from scmmishra/label-auto-fit

refactor: labels for aggregation/percentage chart
This commit is contained in:
Shivam Mishra 2019-07-03 19:24:40 +05:30 committed by GitHub
commit e479e060f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -67,6 +67,9 @@ export default class AggregationChart extends BaseChart {
let divisor = Math.floor(
(this.width - getExtraWidth(this.measures))/barWidth
);
if (this.legendTotals.length < divisor) {
barWidth = this.width/this.legendTotals.length;
}
if(count > divisor) {
count = 0;
y += 20;

View File

@ -19,7 +19,7 @@ export default class PercentageChart extends AggregationChart {
b.depth = b.depth || PERCENTAGE_BAR_DEFAULT_DEPTH;
m.paddings.right = 30;
m.legendHeight = 80;
m.legendHeight = 60;
m.baseHeight = (b.height + b.depth * 0.5) * 8;
}