-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Buggy tick marks when large gaps in time #6431
Comments
Thanks for the detailed report @jacobsorme. I have a PR that fixes this ready on my local machine, but it depends on #6362 and #6355, so I'm hoping folks can review those first and then I'll send the PR for the bug fix |
Wait, having Docs on having Am I missing something here? What would "show all labels no matter what" mean? Is some part of the code calling the things |
The other part of the workaround I suggested was setting |
Oh I forgot about that, thanks! 😅 So since |
Fixed in master: https://jsbin.com/jabafahaxu/1/edit?html,output |
Expected Behavior
I use
type: 'time'
anddistribution: 'series'
as options for an x-axis (options.scales.xAxes
) in a line chart. I then add data of the following type:{t: new Date( ... ), y: ... }
, where there is a gap in time (see pic below). I expect the tick marks to look nice at this point.Current Behavior
This is how the tick marks looks as of now, they get smashed.
Possible Solution
A possible solution proposed by @benmccann when discussing this is to use eg.
autoSkip:true
, andautoSkipPadding:75
as tick configuration for the axis (see in docs ). This however requires you to specify a certain padding (75 in example).To solve this specifying a configuration as above could be to not have tick marks being drawn when there is no data, or have the auto-tick-thing consider possible large gaps in time of data that don't need tick marks.
Steps to Reproduce (for bugs)
See JS Bin here.
Context
I have data points coming from a specific time stamp that I want to show. The data sometimes is of a format where there are lots of data points separated by the same small time-delta, eg. 10 ms. Then there is a gap of say 3 hours, and after that more data in the same way.
Environment
Chart.js/2.8.0/Chart.bundle.min.js
.The text was updated successfully, but these errors were encountered: