Skip to content

Commit

Permalink
chore: update build
Browse files Browse the repository at this point in the history
  • Loading branch information
scmmishra committed Apr 30, 2020
1 parent c3f747c commit 80ef243
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 10 deletions.
10 changes: 8 additions & 2 deletions dist/frappe-charts.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3220,6 +3220,13 @@ function getShortenedLabels(chartWidth, labels=[], isSeries=true) {
if(allowedSpace <= 0) allowedSpace = 1;
let allowedLetters = allowedSpace / DEFAULT_CHAR_WIDTH;

let seriesMultiple;
if(isSeries) {
// Find the maximum label length for spacing calculations
let maxLabelLength = Math.max(...labels.map(label => label.length));
seriesMultiple = Math.ceil(maxLabelLength/allowedLetters);
}

let calcLabels = labels.map((label, i) => {
label += "";
if(label.length > allowedLetters) {
Expand All @@ -3231,8 +3238,7 @@ function getShortenedLabels(chartWidth, labels=[], isSeries=true) {
label = label.slice(0, allowedLetters) + '..';
}
} else {
let multiple = Math.ceil(label.length/allowedLetters);
if(i % multiple !== 0) {
if(i % seriesMultiple !== 0) {
label = "";
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/frappe-charts.min.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/frappe-charts.min.cjs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/frappe-charts.min.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/frappe-charts.min.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/frappe-charts.min.iife.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/frappe-charts.min.iife.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/js/frappe-charts.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/js/frappe-charts.min.js.map

Large diffs are not rendered by default.

0 comments on commit 80ef243

Please sign in to comment.