Skip to content

An open source alternative to Tableau. Embeddable visual analytic

fix: bin count result not match (#113)

Bob8d4f3d8f4d21
diff --git a/packages/graphic-walker/src/lib/execExp.ts b/packages/graphic-walker/src/lib/execExp.ts
index 93c16757..aa586953 100644
--- a/packages/graphic-walker/src/lib/execExp.ts
+++ b/packages/graphic-walker/src/lib/execExp.ts
@@ -82,7 +82,7 @@ function binCount(resKey: string, params: IExpParamter[], data: IDataFrame, binS
const groupSize = valueWithIndices.length / binSize;
- const newValues = valueWithIndices.map(item => {
+ const newValues = valueWithIndices.sort((a, b) => a.index - b.index).map(item => {
let bIndex = Math.floor(item.orderIndex / groupSize);
if (bIndex === binSize) bIndex = binSize - 1;
return bIndex + 1