diff --git a/src/chart/heatmap/HeatmapView.ts b/src/chart/heatmap/HeatmapView.ts index d0de889ba1..235d757ab9 100644 --- a/src/chart/heatmap/HeatmapView.ts +++ b/src/chart/heatmap/HeatmapView.ts @@ -266,9 +266,15 @@ class HeatmapView extends ChartView { continue; } + const contentShape = coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape; + // Ignore data that are not in range + if (isNaN(contentShape.x) || isNaN(contentShape.y)) { + continue; + } + rect = new graphic.Rect({ z2: 1, - shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape, + shape: contentShape, style }); } diff --git a/test/calendar-heatmap2.html b/test/calendar-heatmap2.html new file mode 100644 index 0000000000..f04c145ba0 --- /dev/null +++ b/test/calendar-heatmap2.html @@ -0,0 +1,81 @@ + + + + + + + calendar + + + + + + + + +
+ + + +