Skip to content
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

v2.0-dev x-axis showing ms for dataset in seconds #1941

Closed
mzupan opened this issue Jan 28, 2016 · 8 comments
Closed

v2.0-dev x-axis showing ms for dataset in seconds #1941

mzupan opened this issue Jan 28, 2016 · 8 comments

Comments

@mzupan
Copy link

mzupan commented Jan 28, 2016

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

@mzupan
Copy link
Author

mzupan commented Jan 28, 2016

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/

@mzupan
Copy link
Author

mzupan commented Jan 28, 2016

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

screen shot 2016-01-28 at 10 28 31 am

@etimberg etimberg added the v2.x label Jan 28, 2016
@etimberg
Copy link
Member

@mzupan you can set a hard end point with

scales: {
    xAxes: [{
        time: {
            max: // max time value here.
        }
    }]
}

@mzupan
Copy link
Author

mzupan commented Jan 28, 2016

@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.

@Dergonic
Copy link

Might it be linked to #1825 ?

@mzupan
Copy link
Author

mzupan commented Jan 29, 2016

@Dergonic looks like its the same issue

@etimberg
Copy link
Member

@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'
        }
    }
}

@etimberg
Copy link
Member

etimberg commented Feb 6, 2016

Closing as #1950 was merged

@etimberg etimberg closed this as completed Feb 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants