diff --git a/src/view/OverlayYAxisView.ts b/src/view/OverlayYAxisView.ts index c8acb67f9..d4055a967 100644 --- a/src/view/OverlayYAxisView.ts +++ b/src/view/OverlayYAxisView.ts @@ -66,7 +66,7 @@ export default class OverlayYAxisView extends OverlayVie figures.push({ type: 'text', attrs: { x, y: coordinate.y, text, align: textAlign, baseline: 'middle' }, ignoreEvent: true }) } }) - if (coordinates.length > 1) { + if (coordinates.length > 1 && topY <= bottomY) { figures.unshift({ type: 'rect', attrs: { x: 0, y: topY, width: bounding.width, height: bottomY - topY }, ignoreEvent: true }) } }