Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/component/dataZoom/AxisProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { unionAxisExtentFromData } from '../../coord/axisHelper';
import { ensureScaleRawExtentInfo } from '../../coord/scaleRawExtentInfo';
import { getAxisMainType, isCoordSupported, DataZoomAxisDimension } from './helper';
import { SINGLE_REFERRING } from '../../util/model';
import { getStackedDimension } from '../../data/helper/dataStackHelper';

const each = zrUtil.each;
const asc = numberUtil.asc;
Expand Down Expand Up @@ -303,6 +304,10 @@ class AxisProxy {
return;
}

zrUtil.each(dataDims, function (dim, index) {
dataDims[index] = getStackedDimension(seriesData, dim);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be unexpected to me because this makes const dataDims = seriesData.mapDimensionsAll(axisDim); almost useless.

Found these comments might be related. @100pah Please help review this PR.

Copy link
Author

@archiewood archiewood Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be unexpected to me because this makes const dataDims = seriesData.mapDimensionsAll(axisDim); almost useless.

  • The mapDimensionsAll(axisDim) call is necessary to get all dimensions that map to this axis.
  • Then getStackedDimension() transforms each dimension to its stacked result dimension only if that dimension is stacked - otherwise it returns the original dimension unchanged.

an alternative would be maybe to define dataDims like this, and then not overwrite the elements later, I was just concerned this would be less clear

const dataDims = zrUtil.map(
      seriesData.mapDimensionsAll(axisDim),
      dim => getStackedDimension(seriesData, dim)
  );

});

if (filterMode === 'weakFilter') {
const store = seriesData.getStore();
const dataDimIndices = zrUtil.map(dataDims, dim => seriesData.getDimensionIndex(dim), seriesData);
Expand Down