From 580ba0e7d61935998e7af37f48dc466900071012 Mon Sep 17 00:00:00 2001 From: Adrian Mroz Date: Thu, 1 Dec 2022 13:54:23 +0100 Subject: [PATCH 1/2] resolve with new split, not old one --- src/common/visualization-manifests/line-chart/line-chart.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/visualization-manifests/line-chart/line-chart.ts b/src/common/visualization-manifests/line-chart/line-chart.ts index 29ac6ab60..6c563e70e 100644 --- a/src/common/visualization-manifests/line-chart/line-chart.ts +++ b/src/common/visualization-manifests/line-chart/line-chart.ts @@ -77,7 +77,7 @@ const rulesEvaluator = visualizationDependentEvaluatorBuilder const newContinuousSplit = fixNumberSplit(numberSplit, dimension); if (newContinuousSplit.equals(numberSplit)) return Resolve.ready(isSelectedVisualization ? 10 : 4); - return Resolve.automatic(4, { splits: new Splits({ splits: List([numberSplit]) }) }); + return Resolve.automatic(4, { splits: new Splits({ splits: List([newContinuousSplit]) }) }); }) .when(Predicates.areExactSplitKinds("time", "*")) From ddd167c42e02700bf016b96ef8da4195103da20d Mon Sep 17 00:00:00 2001 From: Adrian Mroz Date: Fri, 2 Dec 2022 15:18:04 +0100 Subject: [PATCH 2/2] handle case with number + category split in wrong order --- .../line-chart/line-chart.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/common/visualization-manifests/line-chart/line-chart.ts b/src/common/visualization-manifests/line-chart/line-chart.ts index 6c563e70e..ba9931cfc 100644 --- a/src/common/visualization-manifests/line-chart/line-chart.ts +++ b/src/common/visualization-manifests/line-chart/line-chart.ts @@ -90,13 +90,27 @@ const rulesEvaluator = visualizationDependentEvaluatorBuilder const colorSplit = splits.getSplit(1); const colorDimension = findDimensionByName(dataCube.dimensions, colorSplit.reference); - const newColorSplit = adjustColorSplit(colorSplit, colorDimension, series, appSettings.customization.visualizationColors); return Resolve.automatic(8, { splits: new Splits({ splits: List([newColorSplit, newTimeSplit]) }) }); }) + .when(Predicates.areExactSplitKinds("number", "*")) + .then(({ splits, series, dataCube, appSettings }) => { + const numberSplit = splits.getSplit(0); + const dimension = findDimensionByName(dataCube.dimensions, numberSplit.reference); + + const newNumberSplit = fixNumberSplit(numberSplit, dimension); + + const colorSplit = splits.getSplit(1); + const colorDimension = findDimensionByName(dataCube.dimensions, colorSplit.reference); + const newColorSplit = adjustColorSplit(colorSplit, colorDimension, series, appSettings.customization.visualizationColors); + + return Resolve.automatic(8, { + splits: new Splits({ splits: List([newColorSplit, newNumberSplit]) }) + }); + }) .when(Predicates.areExactSplitKinds("*", "time")) .then(({ splits, series, dataCube, appSettings }) => {