-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogress.html
79 lines (67 loc) · 2.07 KB
/
progress.html
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
74
75
76
77
78
79
<html>
<head>
<title>Shard - Project Progress</title>
<link rel="icon" type="image/x-icon" href="images/favicon.ico">
<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script id="headerfooter-loader" src="scripts/insertHeaderFooter.js"></script>
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="scripts/progress_data.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['gantt']});
google.charts.setOnLoadCallback(drawAllCharts);
function drawAllCharts() {
Object.entries(progressData).forEach(([k,v]) => {
chartDivId = `chart_div${k}`
$("#charts").append((`<div id='${chartDivId}'></div>`))
console.log("The key: ", k)
console.log("The value: ", v)
drawChart(k)
$(`#${chartDivId}`).prepend(`<br /><h3>Plan as of ${k}</h3>`)
})
}
function drawChart(index) {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Task ID');
data.addColumn('string', 'Task Name');
data.addColumn('string', 'Resource');
data.addColumn('date', 'Start Date');
data.addColumn('date', 'End Date');
data.addColumn('number', 'Duration');
data.addColumn('number', 'Percent Complete');
data.addColumn('string', 'Dependencies');
rowData = []
rowData.push(...progressData[index])
data.addRows(rowData);
var options = {
/* dynamically scale graph as needed */
height: data.getNumberOfRows()*42+38,
backgroundColor: {
fill: '#2e2e2e',
},
gantt: {
criticalPathEnabled: true,
labelStyle: {
fontSize: 14,
color: 'white'
},
arrow: {
//angle: 50,
width: 1.4,
color: '#beb9b0',
radius: 15
},
},
};
var chart = new google.visualization.Gantt(document.getElementById('chart_div'+index));
chart.draw(data, options);
}
</script>
</head>
<body>
<header></header>
<h2>ENG1 Project Progress</h2>
<div id="charts"></div>
<footer></footer>
</body>
</html>