-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchart_html.html
249 lines (227 loc) · 4.67 KB
/
chart_html.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<!DOCTYPE html>
<body>
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">City Choices
<span class="caret"></span></button>
<ul class="dropdown-menu" id="drop">
<li><a value="theme1" href="#">Arcada</a></li>
<li><a value="theme2" href="#">Bakersfield</a></li>
<li><a value="theme3" href="#">Barstow</a></li>
<li><a value="theme4" href="#">...</a></li>
</ul>
</div>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js" type="text/javascript"></script>
<script type="text/javascript" src="jsontest1.json"></script>
<script type="text/javascript" src="javascrip.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" integrity="sha384-aUGj/X2zp5rLCbBxumKTCw2Z50WgIr1vs/PFN4praOTvYXWlVyh2UtNUU0KAUhAX" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>
<script>
var energy_usage_arcada = [
0.608074204,
0.544411129,
0.525074623,
0.524797928,
0.553984697,
0.65812282,
0.842943416,
0.913677313,
0.851582273,
0.807101324,
0.80527975,
0.785704734,
0.755700407,
0.733460933,
0.743948753,
0.830489946,
1.034508098,
1.264347394,
1.399526404,
1.481803691,
1.483634437,
1.288249556,
1.027650078,
0.771887793,
]
var energy_usage_bakersfield = [
0.648540424,
0.554126544,
0.511434689,
0.495384543,
0.51858944,
0.624612334,
0.842126243,
0.929641227,
0.909161809,
0.947829814,
1.007303327,
1.080523538,
1.159665222,
1.255400563,
1.373306938,
1.520174003,
1.798967493,
1.937628511,
1.94102656,
1.888221794,
1.795683334,
1.520534583,
1.182635519,
0.862200709,
]
var energy_usage_barstow = [
0.705975973*5,
0.605050212*5,
0.558646778*5,
0.538434605*5,
0.561437459*5,
0.675498693*5,
0.891261463*5,
0.987888071*5,
0.980792489*5,
1.054202302*5,
1.121052175*5,
1.214496653*5,
1.320051396*5,
1.43436116*5,
1.556162837*5,
1.689862477*5,
1.93764051*5,
2.06540027*5,
2.062988137*5,
2.014830941*5,
1.908180459*5,
1.606081522*5,
1.255123921*5,
0.923990348*5,
]
var solar_prod_arcada = [
0,
0,
0,
0,
0,
0.065154415,
0.400312614,
1.360475459,
2.907673282,
4.317908448,
5.746710895,
6.606723866,
6.761527491,
6.536878807,
5.683675661,
4.180513357,
2.538243693,
1.005421145,
0.215286966,
0.023180874,
0,
0,
0,
0,
]
var solar_prod_bakersfield = [
0,
0,
0,
0,
0,
0.086875286,
0.755009675,
2.517210306,
4.647564354,
6.335909484,
7.560287994,
8.122828441,
8.005766463,
7.38260364,
6.181865738,
4.28705204,
2.235473079,
0.621543532,
0.067874648,
0,
0,
0,
0,
0,
]
var solar_prod_barstow = [
0,
0,
0,
0,
0.002418165,
0.110139673,
1.087305911,
3.405274618,
5.830790752,
7.643919144,
8.799582578,
9.223440038,
8.899030295,
8.134059591,
6.618697482,
4.488081831,
2.175355834,
0.492267622,
0.044369848,
0,
0,
0,
0,
0,
]
$(function () {
$('#container').highcharts({
title: {
text: 'Energy Usage vs Solar Production',
x: -20 //center
},
subtitle: {
text: 'Hourly averages for a city over the course of a year',
x: -20
},
xAxis: {
categories: ['12am', '1am', '2am', '3am', '4am', '5am',
'6am', '7am', '8am', '9am', '10am', '11am',
'12pm', '1pm', '2pm', '3pm', '4pm', '5pm',
'6pm', '7pm', '8pm', '9pm', '10pm', '11pm']
},
yAxis: {
title: {
text: '$ per kWh'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: '°C'
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: [{
name: 'Energy Usage',
data: energy_usage_barstow
}, {
name: 'Solar System Production',
data: solar_prod_barstow
}]
});
});
</script>
</body>