diff --git a/src/component/visualMap/VisualMapModel.ts b/src/component/visualMap/VisualMapModel.ts index 843387a465..14fc48b8ae 100644 --- a/src/component/visualMap/VisualMapModel.ts +++ b/src/component/visualMap/VisualMapModel.ts @@ -462,6 +462,16 @@ class VisualMapModel extends Com return data.getDimensionIndex(optDim); } + // First, try to use the dimension encoded as 'value' if it exists + // This respects the series' encode configuration + const valueDimName = data.mapDimension('value'); + if (valueDimName != null && valueDimName !== '') { + const dimIndex = data.getDimensionIndex(valueDimName); + if (dimIndex >= 0) { + return dimIndex; + } + } + const dimNames = data.dimensions; for (let i = dimNames.length - 1; i >= 0; i--) { const dimName = dimNames[i]; diff --git a/test/heatmap-encode-value-fix.html b/test/heatmap-encode-value-fix.html new file mode 100644 index 0000000000..24029f9c87 --- /dev/null +++ b/test/heatmap-encode-value-fix.html @@ -0,0 +1,85 @@ + + + + + Heatmap Encode Value Bug Fix Test + + + +
+ + +