Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d23be99

Browse files
committed
fixes timezone offsets in gl3d axes
1 parent 7495f4c commit d23be99

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

src/plots/cartesian/set_convert.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ module.exports = function setConvert(ax, fullLayout) {
9898
// same logic as in Lib.ms2DateTime
9999
var msecTenths = Math.floor(Lib.mod(v + 0.05, 1) * 10);
100100
var msRounded = Math.round(v - msecTenths / 10);
101-
ms = dateTime2ms(new Date(msRounded)) + msecTenths / 10;
101+
102+
var now = (new Date(msRounded)).getTime();
103+
ms = now + msecTenths / 10;
102104
}
103105
else return BADNUM;
104106
}
21.7 KB
Loading
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"data": [
3+
{
4+
"type": "scatter3d",
5+
"x": ["2020-01-01 01:00:00", "2020-01-01 13:00:00"],
6+
"y": ["2020-01-01 01:00:00", "2020-01-01 02:00:00"],
7+
"z": ["2020-01-01 01:00:00", "2020-01-01 01:30:00"]
8+
}
9+
],
10+
"layout": {
11+
"title": "Day time period",
12+
"width": 800,
13+
"height": 600,
14+
"scene": {
15+
"xaxis": { "nticks": 12, "type": "date" },
16+
"yaxis": { "nticks": 12, "type": "date" },
17+
"zaxis": { "nticks": 12, "type": "date" },
18+
"camera": {
19+
"eye": { "x": -2, "y": 0.5, "z": 1 },
20+
"center": { "x": 0, "y": 0, "z": 0 },
21+
"up": { "x": 0, "y": 0, "z": 1 }
22+
}
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)