palantir / plottable

:bar_chart: A library of modular chart components built on D3
http://plottablejs.org/
MIT License
2.97k stars 223 forks source link

[Time Axis] shifted based on browser time zone if values specified in UTC #1868

Open jtlan opened 9 years ago

jtlan commented 9 years ago

screen shot 2015-04-21 at 12 48 33 pm Repro http://jsfiddle.net/cgh159Ld/3/

Actual: Bars and Axes.Time are shifted by the local offset from UTC. Expected: Bars and Axes.Time are aligned on date-boundaries, as no hours were specified in either the data or the domain.

EDIT 2015-11-16: Only the Axis is shifted; the data is in the right spot, as evidenced by http://jsfiddle.net/jx74a51x/

aicioara commented 9 years ago

Repro http://jsfiddle.net/cgh159Ld/3/

aicioara commented 9 years ago

If you want Dates nicely specified, you need to not use the UTC notation, hence this will work http://jsfiddle.net/cgh159Ld/6/

aicioara commented 9 years ago

However, discovered this https://github.com/palantir/plottable/issues/2447

jtlan commented 8 years ago

Reopen, since I think we might want to consider if UTC is more appropriate by default, since it will produce consistent visual results regardless of the time zone you are in. It also plays better with Date values generated using millisecond time stamps.

However, this would be a breaking change (non-API), so we should do it in v2.0.0.

jtlan commented 8 years ago

Clearer repro using Plots.Scatter: http://jsfiddle.net/jx74a51x/

screen shot 2015-11-16 at 11 50 56 am

Avoiding shifts using local time strings: http://jsfiddle.net/fdkngxmj/ Doesn't seem very convenient though, and unix timestamps are still broken.

jtlan commented 8 years ago

Scales.Time would also have to be UTC to fix this.

jtlan commented 8 years ago

Since "assume all dates are local" is also consistent, and we're not sure if switching to "assume all dates are UTC" will yield immediate benefits, going to defer this.