A tick is sometimes rendered outside of the user-defined max
axis limit when includeBounds=false
#11083
Labels
Milestone
max
axis limit when includeBounds=false
#11083
Expected behavior
When
includeBounds
on the axis of a line chart is set tofalse
andmin
andmax
of the axis are defined, there shouldn't be any ticks outside of the defined axis limits.Current behavior
In some cases, a tick is created outside of the user-defined
max
axis limit. This especially happens with small axis limits (in my code sample:min: 2.404e-8, max: 2.4141e-8
).Reproducible sample
https://codepen.io/CodingMarco/pen/vYadxqv
Optional extra steps/info to reproduce
No response
Possible solution
Please see my proposed fix: CodingMarco@1f1fd79.
This commit would fix the issue, however I'm looking for feedback if this is the correct way of fixing it.
Maybe another option would be to fix the calculation of numSpaces, but I think the advantage of my proposed fix is that it works in all edge cases.
All currently existing tests run successfully with my fix.
Context
When plotting eye diagrams commonly used to characterize digital signals, it looks very ugly if there is space next to the eye diagram (without the fix, see left image). With my proposed fix, it looks much better (see right image).
chart.js version
v4.2.0
Browser name and version
No response
Link to your project
No response
The text was updated successfully, but these errors were encountered: