Chartjs-Why Chart.js v2 time based data not aligning with X axis correctly?

0👍

Regarding the showing on the wrong date:

This is because of how you instantiate a date object and how it relates to timezones, your browser is likely resolving that to your timezone and you get a different value.

I am on GMT-3 and this is what happens for me for example:

$ new Date('2016-11-30')
- Tue Nov 29 2016 21:00:00 GMT-0300 (BRT)

$ new Date(2016, 11, 30)
- Fri Dec 30 2016 00:00:00 GMT-0300 (BRT)

Regarding not showing last data:

The bar is plotted but it’s not on visible location. It’s possible to verify this on this JSFiddle (not sure why not on codepen), if you move your mouse to the very edge of the screen the label will appear.

This is a known issue and is being tracked here: #2415

If possible, I think that the easiest workaround would be to manually define a max property on your time scale

Leave a comment