Single timeseries bar chart creates multiple ticks
Expected behavior
Creating a timeseries based bar chart with only a single bar and setting the ticks source to data will result in two additional but undesired ticks (marked in red color) left and right to the single tick coming from the data itself:
The issue can be found in _generate() in this commit. Here, min and max result in the additional ticks as they both have very small offset to the data itself (exactly 1 ms).
Current behavior
See a sample here: https://stackblitz.com/edit/js-vssd2m. You'll immediately notice the effect:
- The first chart shows a single bar with tree ticks.
- The second chart shows two bars (or more) that no longer show the effect of undesired ticks.
Reproducible sample
https://stackblitz.com/edit/js-vssd2m
Optional extra steps/info to reproduce
No response
Possible solution
See the _generate() function. min and max show a slight offset hence the timestamps array is extended with the additional ticks.
Context
No response
chart.js version
v4.4.0
Browser name and version
Firefox v118
Link to your project
No response