-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscripts.js
77 lines (69 loc) · 1.8 KB
/
scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
document.addEventListener('DOMContentLoaded', function() {
const data = [
{
Task: 'Central Europe',
Start: '2025-04-15 12:00:00',
Finish: '2025-04-15 17:00:00',
Color: 'blue',
},
{
Task: 'America/Eastern',
Start: '2025-04-15 15:00:00',
Finish: '2025-04-15 23:00:00',
Color: 'orange',
},
{
Task: 'America/Pacific',
Start: '2025-04-15 19:00:00',
Finish: '2025-04-16 03:00:00',
Color: 'green',
},
{
Task: 'Asia/Pacific',
Start: '2025-04-16 1:00:00',
Finish: '2025-04-16 9:00:00',
Color: 'red',
},
{
Task: 'Asia/Pacific',
Start: '2025-04-16 8:00:00',
Finish: '2025-04-16 9:00:00',
Color: 'red',
},
{
Task: 'Central Europe',
Start: '2025-04-16 7:00:00',
Finish: '2025-04-16 12:00:00',
Color: 'blue',
},
];
const tasks = data.map(d => ({
x: [d.Start, d.Finish],
y: [d.Task, d.Task],
type: 'scatter',
line: { width: 20, color: d.Color},
//mode: 'lines',
marker: {},
label: d.Task,
}));
const layout = {
xaxis: {
type: 'date',
title: 'Time (UTC)'
},
margin: {
l: 150, // Increase left margin to make room for y-axis labels
r: 0,
t: 35,
b: 50
},
showlegend: false,
height: 250,
hovermode: 'closest'
};
const config = {
displayModeBar: false,
responsive: true
};
Plotly.newPlot('gantt-chart', tasks, layout, config);
});