Переглянути джерело

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

refactor: labels for aggregation/percentage chart
tags/1.2.3
Shivam Mishra 6 роки тому
committed by GitHub
джерело
коміт
e479e060f0
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: 4AEE18F83AFDEB23
2 змінених файлів з 4 додано та 1 видалено
  1. +3
    -0
      src/js/charts/AggregationChart.js
  2. +1
    -1
      src/js/charts/PercentageChart.js

+ 3
- 0
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;


+ 1
- 1
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;
}



Завантаження…
Відмінити
Зберегти