From 94c835115b946bad3dc383023c8a8bcb0abe73e2 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 3 Jul 2019 17:40:55 +0530 Subject: [PATCH 1/2] feat: labels will auto fit wrapper width --- src/js/charts/AggregationChart.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/js/charts/AggregationChart.js b/src/js/charts/AggregationChart.js index 68f4699..a5bfec8 100644 --- a/src/js/charts/AggregationChart.js +++ b/src/js/charts/AggregationChart.js @@ -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; From e142a5ed93d2d617542f88bf300842b28a8d8354 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 3 Jul 2019 17:53:23 +0530 Subject: [PATCH 2/2] fix: legend height --- src/js/charts/PercentageChart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/charts/PercentageChart.js b/src/js/charts/PercentageChart.js index beb80b1..cd91469 100644 --- a/src/js/charts/PercentageChart.js +++ b/src/js/charts/PercentageChart.js @@ -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; }