Skip to content

Commit

Permalink
make to change the getBreakPoints of polygon chart (#19573)
Browse files Browse the repository at this point in the history
  • Loading branch information
prosdev0107 authored Apr 11, 2022
1 parent 4bf4d58 commit d8b9e72
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ export function getBreakPoints(
const precision =
delta === 0 ? 0 : Math.max(0, Math.ceil(Math.log10(1 / delta)));
const extraBucket = maxValue > maxValue.toFixed(precision) ? 1 : 0;
const startValue =
minValue < minValue.toFixed(precision) ? minValue - 1 : minValue;

return new Array(numBuckets + 1 + extraBucket)
.fill()
.map((_, i) => (minValue + i * delta).toFixed(precision));
.map((_, i) => (startValue + i * delta).toFixed(precision));
}

return formDataBreakPoints.sort((a, b) => parseFloat(a) - parseFloat(b));
Expand Down

0 comments on commit d8b9e72

Please sign in to comment.