New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Labels not aligned properly on line graph/stepSize ignored? #4104
Comments
I believe this is something to do with the size of the data set. If I have more than around 100 data points in my graph, the last section skews. |
@sbowman what kind of x axis are you using? From the snippet above it looks like you're using the default category axis but the values are specified as dates and times. Have you tried the time axis? options: {
scales: {
xAxes: [{
type: 'time'
}]
}
} |
I was just using string values, not time. |
Refactored using type: 'time'...working as expected now. Thank you for that pointer; not sure how I missed the "time" axis. Also made my code much cleaner! |
Awesome, can I close this out? |
Sorry...thought I tapped the close button. |
Expected Behavior
When creating a line graph spanning 720 minutes, the vertical lines should be evenly spaced.
For smaller data sets on other graphs (7, 48), this worked fine, i.e. the labels are evenly spaced. Didn't need stepSize or fixedStepSize, only maxTicksLimit.
Current Behavior
Currently, the last line/right edge is stretched to the right so the last segment is double the size of the other segments. Labels are not evenly spaced (using momentjs to create per-minute labels).
Steps to Reproduce (for bugs)
Note that it doesn't obey the fixedStepSize or stepSize. In the sample screenshot, the ends line up, 2:30 AM and 2:30 PM, but the divisions are off. 2:30 AM to 3:26 AM is not 60 minutes.
I also tried using 719 values, instead of 720. Same results.
Environment
The text was updated successfully, but these errors were encountered: