forked from chartjs/Chart.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid tooltip truncation in x axis if there is enough space (chartjs#…
…3998) * In tooltip x align calculation take into account caretSize Truncation up to caretSize pixels could happen if label text produced tooltip element with size width: * left side tooltip: width < x and width > x - caretSize * right side tooltip: width < chartWidth - x and width > chartWidth - x - caretSize Default caretSize = 5, so with default configuration truncation up to 5 pixels could happen. * avoid tooltip truncation if possible use whole chart area for displaying tooltip * in xAlign calculation take into account caretPadding * add tests for tooltip truncation avoid logic * use caretX instead of xCaret * fix lint errors
- Loading branch information
1 parent
939756c
commit 683e86e
Showing
2 changed files
with
78 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters