v2.0-dev x-axis showing ms for dataset in seconds
I have the following example
https://jsfiddle.net/d0txbo3e/1/
It adds 10 data points each a second a part. The issue is the x-axis is showing ms instead of what I'm expecting.
If i change
return moment().add(days, 's').format();
to
return moment().add(days, 'm').format();
It shows correct. My only guess is it might have something to do with the labels on the ticks and there aren't enough data points?
Thanks
Ok it does seem to be a lack of data issue. I updated with more data and getting the results I'd expect.
https://jsfiddle.net/d0txbo3e/2/
Also another question.. in the
https://jsfiddle.net/d0txbo3e/2/
You'll notice there is a padding where the last value isn't at the end of the graph. On my test with a lot more data it seems even worse

@mzupan you can set a hard end point with
scales: {
xAxes: [{
time: {
max: // max time value here.
}
}]
}
@etimberg thanks for the quick reply. I updated this with the example with setting a max for time
https://jsfiddle.net/d0txbo3e/4/
I'm not seeing any changes but still see the shifting and showing empty data.
Might it be linked to https://github.com/nnnick/Chart.js/pull/1825 ?
@Dergonic looks like its the same issue
@mzupan take a look at #1950
I've updated your fiddle at https://jsfiddle.net/kfts0jdg/1/
As an immediate fix for the label issue you can add the following to your config
{
time: {
displayFormats: {
millisecond: 'h:mm:ss.SSS a'
}
}
}
Closing as #1950 was merged