mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
Add extra bucket when max outside range (#7264)
This commit is contained in:
parent
05afe1b8c2
commit
984b04d1e5
@ -38,7 +38,8 @@ export function getBreakPoints({
|
|||||||
const precision = delta === 0
|
const precision = delta === 0
|
||||||
? 0
|
? 0
|
||||||
: Math.max(0, Math.ceil(Math.log10(1 / delta)));
|
: Math.max(0, Math.ceil(Math.log10(1 / delta)));
|
||||||
return Array(numBuckets + 1)
|
const extraBucket = maxValue > maxValue.toFixed(precision) ? 1 : 0;
|
||||||
|
return Array(numBuckets + 1 + extraBucket)
|
||||||
.fill()
|
.fill()
|
||||||
.map((_, i) => (minValue + i * delta).toFixed(precision));
|
.map((_, i) => (minValue + i * delta).toFixed(precision));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user