Skip to content

Commit

Permalink
fix #4734; last annotation was not shown because of a refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Sep 30, 2024
1 parent 167c5a9 commit 821754e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/modules/annotations/Helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
Expand Down

0 comments on commit 821754e

Please sign in to comment.