Skip to content

Commit 18f0316

Browse files
authored
Merge pull request #20699 from apache/fix/heatmap-label
fix(heatmap): fix labels not in calendar range are unexpectedly displayed
2 parents 1d4895f + 2872e5c commit 18f0316

File tree

2 files changed

+88
-1
lines changed

2 files changed

+88
-1
lines changed

src/chart/heatmap/HeatmapView.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,15 @@ class HeatmapView extends ChartView {
266266
continue;
267267
}
268268

269+
const contentShape = coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape;
270+
// Ignore data that are not in range
271+
if (isNaN(contentShape.x) || isNaN(contentShape.y)) {
272+
continue;
273+
}
274+
269275
rect = new graphic.Rect({
270276
z2: 1,
271-
shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,
277+
shape: contentShape,
272278
style
273279
});
274280
}

test/calendar-heatmap2.html

Lines changed: 81 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)