From f0e4ded211ed427eef489fd89e397d379ec28dce Mon Sep 17 00:00:00 2001 From: smileydev <47900232+prosdev0107@users.noreply.github.com> Date: Mon, 11 Apr 2022 17:20:20 -0400 Subject: [PATCH] make to change the getBreakPoints of polygon chart (#19573) --- .../plugins/legacy-preset-chart-deckgl/src/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utils.js b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utils.js index 5b3bc9dfdf123..4de17a9309b43 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utils.js +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utils.js @@ -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));