-
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
[BUG] Barchart: setting xaxes 'type: time' is causing bars to be drawn off canvas. #5312
Comments
Your fiddle doesn't work for me (no data displayed), but the screenshot is the expected behavior when Can you fix your fiddle and keep |
@simonbrunel did you access the fiddle in firefox? It doesn't work in FF for some reason. I tested in chrome and it works. *EDIT: The daily chart works in FF. The monthly doesn't i'm assuming because moment js complains about the date format in the monthly view. I updated the fiddle with another chart, whee the data is daily, and you can see the rather large margins. |
I have forked and fixed @codyflynnNC's fiddle: https://jsfiddle.net/nagix/oyeu2yzt/. With |
I confirm the issue: https://jsfiddle.net/ntfxds2o/3/ I you comment the line: time: { min: '2019-01-01T00:00Z', max: '2019-01-10T00:00Z' }, then the I think that the |
I was writing a PR, but actually it seems this has been fixed by #6264 |
I filed a bug for the issue @schlachtzeuger mentioned, which still remains #6540. I added some info there in case anyone wants to try fixing it I'll close this issue since the |
Expected Behavior
All bars should be drawn on canvas and visible.
Current Behavior
Currently, the bars at the beginning and end of the datasets are being drawn off canvas.
Possible Solution
Currently can be fixed by removing type: 'time' and letting chartjs infer the type.
Also can be "fixed" by adding offset: true to the x-axis, however, this adds large margins to the start and of end of chart and looks really bad.
Steps to Reproduce (for bugs)
jsfiddle
type: 'time'
Screenshot:
Environment
The text was updated successfully, but these errors were encountered: