Plotly.js: Fractional milliseconds in time series are not handled correctly.

Created on 8 Feb 2017  路  4Comments  路  Source: plotly/plotly.js

Hi,

When I'm using scatter chart to display time series with fractional milliseconds, the fractional part is not displayed correctly. Multiple samples become one, this looks strange, for sure it's not the user expects to see on high resolution. The problem persists in all versions of plotly.js since 1.21.0. Version 1.20.5 doesn't have this problem.

Example on jsfiddle:
1.20.5 (expected behaviour)
1.23.0 (issue is reproduced)

bug

Most helpful comment

Yes, definitely a bug, we're clipping fractional msec because we go through native JS dates here and native dates do not support fractional milliseconds. Should be a fairly easy fix.

@SemmZemm - we'll fix this, but it's highly recommended to use date strings instead of millisecond numbers. If you do this, it works fine, and as a side benefit your plots will be portable across timezones.

All 4 comments

@alexcjohnson can you comment on this?

I suspect this is a side-effect of https://github.com/plotly/plotly.js/pull/1194.

Yes, definitely a bug, we're clipping fractional msec because we go through native JS dates here and native dates do not support fractional milliseconds. Should be a fairly easy fix.

@SemmZemm - we'll fix this, but it's highly recommended to use date strings instead of millisecond numbers. If you do this, it works fine, and as a side benefit your plots will be portable across timezones.

@alexcjohnson, you mentioned that the precision is 100 microseconds now in this thread.
Isn't it possible to close this issue?

@hidai I'm afraid this bug is still open. 100 microseconds resolution works when you use date strings, but the issue here is when you provide the data as epoch milliseconds, and that still drops to 1 millisecond resolution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

n-riesco picture n-riesco  路  3Comments

emanuelsetitinger picture emanuelsetitinger  路  3Comments

pynklu picture pynklu  路  3Comments

bryaan picture bryaan  路  3Comments

chriddyp picture chriddyp  路  3Comments