mirror of https://github.com/apache/superset.git
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
|
||||
? 0
|
||||
: 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()
|
||||
.map((_, i) => (minValue + i * delta).toFixed(precision));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue