I’ve tried several options:
1: time series as strings:
z: [[‘2019-04-04 20:23:00’, ‘2019-04-04 20:43:00’], [‘2019-04-04 20:23:00’, ‘2019-04-04 20:43:00’], [‘2019-04-04 20:23:00’, ‘2019-04-04 20:43:00’], [‘2019-04-04 20:23:00’, ‘2019-04-04 20:43:00’], [‘2019-04-04 20:23:00’, ‘2019-04-04 20:43:00’]],
or as a date objects:
var date1 = Date.parse(‘2019-04-04 20:23:00’);
var date2 = Date.parse(‘2019-04-04 20:43:00’);
var date3 = Date.parse(‘2019-04-04 21:23:00’);
var date4 = Date.parse(‘2019-04-04 21:43:00’);
var date5 = Date.parse(‘2019-04-04 22:23:00’);
z: [[date1, date2], [date1, date2], [date1, date2], [date1, date2], [date1, date2]],
The whole code looks like this:
var date1 = Date.parse('2019-04-04 20:23:00');
var date2 = Date.parse('2019-04-04 20:43:00');
var date3 = Date.parse('2019-04-04 21:23:00');
var date4 = Date.parse('2019-04-04 21:43:00');
var date5 = Date.parse('2019-04-04 22:23:00');
var trace2 = {
x: [[1, 1], [2, 2], [3, 3], [4, 4], [5, 5]],
y: [[10, 10], [20, 20], [30, 30], [40, 40], [50, 50]],
//z: [[date1, date2], [date1, date2], [date1, date2], [date1, date2], [date1, date2]],
z: [['2019-04-04 20:23:00', '2019-04-04 20:43:00'], ['2019-04-04 20:23:00', '2019-04-04 20:43:00'], ['2019-04-04 20:23:00', '2019-04-04 20:43:00'], ['2019-04-04 20:23:00', '2019-04-04 20:43:00'], ['2019-04-04 20:23:00', '2019-04-04 20:43:00']],
name: '',
type: 'surface',
showscale: false
}
var trace3 = {
x: [[1, 1], [2, 2], [3, 3], [4, 4], [5, 5]],
y: [[11, 11], [21, 21], [31, 31], [42, 42], [23, 23]],
//z: [[date4, date5], [date4, date5], [date4, date5], [date4, date5], [date4, date5]],
z: [['2019-04-04 21:43:00', '2019-04-04 22:23:00'], ['2019-04-04 21:43:00', '2019-04-04 22:23:00'], ['2019-04-04 21:43:00', '2019-04-04 22:23:00'], ['2019-04-04 21:43:00', '2019-04-04 22:23:00'], ['2019-04-04 21:43:00', '2019-04-04 22:23:00']],
type: 'surface',
showscale: false
}
var data = [trace2, trace3];
var layout = {
title: 'Frequency',
showlegend: false,
autosize: true,
width: 600,
height: 600,
scene: {
xaxis: {title: 'X Length'},
yaxis: {title: 'Y Reflection'},
zaxis: {title: 'Z Time'
},
aspectratio: {
x: 1,
y: 1,
z: 1
},
camera: {
center: {
x: 0,
y: 0,
z: 0
},
eye: {
x: 1.1, y: 0.1, z: 2.5
},
up: {
x: 0,
y: 1,
z: 0
},
},
}
};
Plotly.newPlot('myDiv', data, layout, {showSendToCloud: false, responsive: true, displayModeBar: false});