Skip to content

Commit 0b863d1

Browse files
authored
Merge pull request #21042 from apache/fix-relativeTo
fix(marker): fix bug of #20166
2 parents aad95b3 + 3aac20d commit 0b863d1

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/component/marker/MarkPointView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function updateMarkerLayout(
4343
const coordSys = seriesModel.coordinateSystem;
4444
const apiWidth = api.getWidth();
4545
const apiHeight = api.getHeight();
46-
const coordRect = coordSys.getArea && coordSys.getArea();
46+
const coordRect = coordSys && coordSys.getArea && coordSys.getArea();
4747
mpData.each(function (idx: number) {
4848
const itemModel = mpData.getItemModel<MarkPointDataItemOption>(idx);
4949
const isRelativeToCoordinate = itemModel.get('relativeTo') === 'coordinate';

src/component/marker/markerHelper.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,12 @@ export function dataTransform(
154154
if (item.coord == null || !isArray(dims)) {
155155
item.coord = [];
156156
const baseAxis = seriesModel.getBaseAxis();
157-
const otherAxis = coordSys.getOtherAxis(baseAxis);
158-
item.value = numCalculate(data, data.mapDimension(otherAxis.dim), item.type);
157+
if (baseAxis) {
158+
const otherAxis = coordSys.getOtherAxis(baseAxis);
159+
if (otherAxis) {
160+
item.value = numCalculate(data, data.mapDimension(otherAxis.dim), item.type);
161+
}
162+
}
159163
}
160164
else {
161165
// Each coord support max, min, average

test/dataZoom-action.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)