-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGraphTest.html
117 lines (90 loc) · 2.77 KB
/
GraphTest.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html>
<head>
<title>Line Graph Test</title>
<!-- <script type="text/javascript">
function loadFile(o)
{
var fr = new FileReader();
fr.onload = function(e)
{
showDataFile(e, o);
};
fr.readAsText(o.files[0]);
}
function showDataFile(e, o)
{
document.getElementById("data").innerText = e.target.result;
}
</script>
</script> -->
<style type="text/css">
#container {
min-width: 310px;
max-width: 800px;
height: 400px;
margin: 0 auto
}
</style>
<!-- <script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/series-label.js"></script> -->
<!-- <script src="https://code.highcharts.com/modules/exporting.js"></script> -->
<!-- <div id="container"></div> -->
<!-- <script async src= "/GraphTest.js"></script>
<script async src="//jsfiddle.net/01vq934x/embed/"></script> -->
</head>
<body>
<h1>Cosme's Attempt to Display Last Year's Altitude Data</h1><br /><a href= "oopsies.github.io">Back to Oopsie</a><br />
Enter File With X Values: <input type="file" onchange="loadFile(this)">
<pre id="data"></pre>
<script src="../../code/highcharts.js"></script>
<!-- <script src="../../code/modules/exporting.js"></script> -->
<div id="container"></div>
<script type="text/javascript">
function loadFile(o)
{
var fr = new FileReader();
fr.onload = function(e)
{
showDataFile(e, o);
};
fr.readAsText(o.files[0]);
}
function showDataFile(e, o)
{
document.getElementById("data").innerText = e.target.result;
}
var inputX;
var inputX = "0,6,12,18,24,30".split(",");
//console.log(inputX);
Highcharts.chart('container', {
title: {
text: 'Altitude of Pi Balloon'
},
subtitle: {
text: 'Source: Sense_Hat Data'
},
yAxis: {
title: {
text: 'Altitude (Meters)'
}
},
xAxis: {
title: {
text: 'Time (Seconds)'
}
},
series: [{
data: [
[inputX[0], 216],
[inputX[1], 226],
[inputX[2], 226],
[inputX[3], 224],
[inputX[4], 223],
[inputX[5], 221],
]
}]
});
</script>
</body>
</html>