From 821754e4460569c9e6535714d83b4f41856fae8b Mon Sep 17 00:00:00 2001 From: Juned Chhipa Date: Tue, 1 Oct 2024 00:51:21 +0530 Subject: [PATCH] fix #4734; last annotation was not shown because of a refactor --- src/modules/annotations/Helpers.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/annotations/Helpers.js b/src/modules/annotations/Helpers.js index df0c26eaa..ac06db47d 100644 --- a/src/modules/annotations/Helpers.js +++ b/src/modules/annotations/Helpers.js @@ -219,8 +219,13 @@ export default class Helpers { w.globals.barWidth * anno.seriesIndex } - xP = Math.min(Math.max(xP, 0), w.globals.gridWidth) - clipped = xP === 0 || xP === w.globals.gridWidth + if (xP > w.globals.gridWidth) { + xP = w.globals.gridWidth + clipped = true + } else if (xP < 0) { + xP = 0 + clipped = true + } return { x: xP, clipped } }