-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.html
executable file
·370 lines (322 loc) · 43.9 KB
/
demo.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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<script type="text/javascript" charset="utf-8" src="docs/js/raphael-min.js"></script>
<script type="text/javascript" charset="utf-8" src="sai-min.js"></script>
<script type="text/javascript" charset="utf-8" src="data/us.svg.json"></script>
<script type="text/javascript" charset="utf-8" src="data/europe.svg.json"></script>
<script type="text/javascript" charset="utf-8" src="data/world.svg.json"></script>
<script type="text/javascript">
window.onload = function() {
create_charts();
}
</script>
</head>
<body>
<div id="c1" style="width: 400px; height: 400px; float: left;"></div>
<div id="c2" style="width: 400px; height: 400px; float: left;"></div>
<div id="c3" style="width: 400px; height: 400px; float: left;"></div>
<div id="c4" style="width: 400px; height: 400px; float: left;"></div>
<div id="c5" style="width: 400px; height: 400px; float: left;"></div>
<div id="c6" style="width: 800px; height: 650px; float: left;"></div>
<div id="c7" style="width: 400px; height: 400px; float: left;"></div>
<div id="c8" style="width: 400px; height: 400px; float: left;"></div>
<div id="c9" style="width: 600px; height: 600px; float: left;"></div>
<script type="text/javascript">
create_charts = function() {
var orange = '#AA5128';
var olive = '#615C3E';
var gold = '#CABC5C';
var lilac = '#B3A4B7';
var tea = '#E7ECE6';
var ucla = '#536895';
var shipping_colors = {
'Track.com Shipping Index': '#087812',
'Baltic Dry Index': '#444444',
};
var badData = {
"date": ["5/10/2010", "5/11/2010", "12-May"],
"MSFT": [30.0, 28.0, 21.0],
"AAPL": [5.0, 6.0, 11.0]
};
var colors = {
'AAPL': orange,
'AMZN': olive,
'GOOG': gold,
'MSFT': lilac,
'Month': 'red',
' ': 'palegoldenrod',
}
var data = {
'AAPL': [1, 2, 0, 0, 4, 7, 5, 1, -4, -2, -.1, null],
'AMZN': [4, 5, 12, 1, -3, "hello", -6, 6, 4, null, null, null],
'GOOG': [7, 4, 1, 11, 2, 2, 3, 0, 0, 0, 2, 3],
'MSFT': [null, null, null, 1, " 5 ", 6, 3, 8, 3, 4, 7, 1],
'Month': ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'],
};
var delta_data = {
'AAPL': [1, 2, 3, null, 4, 7, 5, 1, -4, -2, -1, null],
//'AMZN': [4, 5, 12, 1, -3, "hello", -6, 6, 10, 6, 4, 2],
//'GOOG': [700, 404, 164, 1125, 248, 217, 392, null, 256.5, 226, 698, -116],
'MSFT': [5, 2, null, 1, 5, 6, 3, 8, 3, 4, 7, 1],
'Month': ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 2000],
};
var data2 = {
'AAPL': [1, 2, 3, null, 4, 7, 5, 1, -4, -2, -1, null, 6, 3, 6, 1, 2, 8, 2, 3, 12, 2, 4, 7, 3, 12, 4, 5, 2, null, 1, 5, 6, 3, 8, 3, 4, 7, 3, 6, 1, 2, 8, 2, 3, 12, 27, 14, 10, 1, 3, 5, 7, 9],
'AMZN': [4, 5, 12, 1, -3, "hello", -6, 6, 10, 4, 6, 4, 2, 6, 3, 2, 8, 3, 12, 2, 1, 11, 8, 7, 6, 5, 2, 1, 2, 3, null, 4, 7, 5, 1, -4, -2, -1, null, 6, 3, 6, 1, 2, 8, 2, 3, 12, 2, 4, 7, 3, 12, 4],
'GOOG': [7, 4, 1, 11, 2, 2, 3, null, 2.5, 2, 6, 6, 3, -1, 6, 1, 12, -3, 2, 3, 12, 2, 4, 6, 8, 7, 5, 4, 5, 12, 1, -3, "hello", -6, 6, 10, 4, 6, 4, 2, 6, 3, 2, 8, 3, 12, 2, 1, 11, 8, 7, 6, 5, 2],
'MSFT': [5, 2, null, 1, 5, 6, 3, 8, 3, 4, 7, 3, 6, 1, 2, 8, 2, 3, 12, 27, 14, 10, 1, 3, 5, 7, 9, 7, 4, 1, 11, 2, 2, 3, null, 2.5, 2, 6, 6, 3, -1, 6, 1, 12, -3, 2, 3, 12, 2, 4, 6, 8, 7, 5],
'Month': ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC', 'UND', 'DOD', 'TRED', 'QUTD', 'QND', 'SED', 'STD', 'OTD', 'NVD', 'VNE', 'VNU', 'VND', 'VNT', 'VNQT', 'VNQN', 'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC', 'UND', 'DOD', 'TRED', 'QUTD', 'QND', 'SED', 'STD', 'OTD', 'NVD', 'VNE', 'VNU', 'VND', 'VNT', 'VNQT', 'VNQN'],
};
var csdata = {
//'open': [2, 6, 4, 6, 3, 6, 2, 6, 4, 6, 3, 6, 2, 6, 4, 6, 3, 6],
'close': [4, 4, 5, 2, 4, 7, 4, 4, 5, 2, 4, 7, 4, 4, 5, 2, 4, 7],
'high': [5, 8, 6, 6, 5, 7, 5, 8, 6, 6, 5, 7, 5, 8, 6, 6, 5, 7],
'low': [1, 3, 2, 1, 3, 4, 1, 3, 2, 1, 3, 4, 1, 3, 2, 1, 3, 4],
'price': [4, 4, 5, 2, 4, 7, 4, 4, 5, 2, 4, 7, 4, 4, 5, 2, 4, 7],
'time': ['t1', 't2', 't3', 't4', 't5', 't6', 't1', 't2', 't3', 't4', 't5', 't6', 't1', 't2', 't3', 't4', 't5', 't6'],
};
var msft_data = {
'Open': [24.74,24.8,24.93,24.65,24.97,25.25,25.06,25.46,25.11,25.4,25.92,25.92,25.69,25.6,25.91,25.76,25.4,24.46,24.98,24.68,24.99,25.44,25.57,25.66,25.59,26.14,25.9,26.45,26.49,26.42,26.46,26.56,29.2,28.12,28.73,28.24,28.07,28.03,27.7,27.64,27.69,28.52,28.38,28.62,28.9,29.08,29.01,29.47,29.61,29.5,30,29.99,29.66,29.84,29.95,29.81,29.79,29.11,29.15,29.52,29.9,29.84,30.05,29.78,29.52,29.47,29.71,29.97,29.91,29.89,30.07,29.95,29.84,30.4,30.6,30.71,30.88,31,31,31.35,31.15,30.98,30.48,30.62,30.85,30.88,30.63,30.28,30.71,30.15,30.26,30.31,31.08,30.86,30.75,30.81,30.61,30,29.24,29.2,29.35,29.84,29.9,28.39,28.37,28.26,28.38,28,28.01,27.97,28.03,27.93,27.81,27.93,28.13,28.53,28.59,28.79,28.84,28.68,28.52,28.27,28.65,28.77,29.08,28.51,28.46,28.66,28.52,28.56,28.86,28.89,29.32,29.18,29.42,29.5,29.63,29.76,29.5,29.59,29.72,29.83,30.09,29.71,29.63,29.64,29.35,29.16,29.13,29.15,29.16,29.32,29.95,30.25,30.15,30.79,30.82,30.79,30.77,31.22,31.33,31.04,31.12,31,30.95,30.92,30.93,31.07,30.67,30.52,29.77,29.59,28.88,29.01,28.68,28.98,29.26,29.2,29.12,28.87,28.52,27.65,26.63,26.85,25.65,26.23,25.73,25.84,25.8,25.53,26.06,26.55,26.1,25.82,25.25,25.22,25.13,25.04,25.86,25.75,26.47,26.56,26.37,26.78,26.16,25.78,25.46,25.05,24.51,24.13,23.3,23.09,23.36,23.27,23.7,23.82,24.6,24.33,24.43,25.14,25.5,25.5,25.51,24.96,24.86,25.6,25.51,25.84,25.86,26.14,26.07,26.13,25.75,25.99,26.2,26.15,25.49,25.18,25.55,25.33,24.68,24.42,24.35,24.36,24.71,24.68,24.62,24.31,24.44,24.09,24,24.09,23.88,23.74,23.6,23.67,23.88,24.24,24.29,24.1],
'Close': [24.78,25,24.86,25,25.2,25.2,25.3,25.26,25.3,25.77,25.69,25.94,25.55,25.83,25.75,25.72,24.88,24.96,24.64,25.11,25.1,25.67,25.55,25.72,25.81,25.96,26.71,26.5,26.36,26.37,26.58,26.59,28.02,28.68,28.59,28.02,28.22,27.73,27.88,27.53,28.06,28.47,28.52,28.99,29.01,29.12,29.36,29.63,29.54,30,30.11,29.78,29.62,29.94,29.91,29.79,29.79,29.22,29.41,30.01,29.78,29.83,29.98,29.79,29.57,29.71,29.87,29.85,30.11,30.02,30.1,29.6,30.36,30.52,30.82,30.92,31,31,31.17,31.39,30.96,30.48,30.48,30.95,30.96,30.77,30.45,30.66,30.27,30.07,30.35,30.96,30.86,30.86,31.1,30.58,30.01,28.96,29.32,29.5,29.67,29.16,28.18,28.41,28.46,28.63,27.84,28.02,27.72,28.01,27.99,28.12,27.93,27.93,28.35,28.59,28.97,28.77,28.73,28.33,28.63,28.6,28.67,29.02,28.46,28.46,28.63,28.59,28.63,28.8,28.97,29.18,29.27,29.29,29.37,29.63,29.61,29.59,29.6,29.88,29.65,30.01,29.66,29.59,29.77,29.29,29.16,29.16,29.27,29.32,29.35,29.92,30.34,30.32,30.45,30.82,30.87,30.67,31.04,31.36,31.33,31.39,30.96,31.11,30.84,30.91,31,30.54,30.86,30.13,29.85,28.98,28.21,28.94,28.88,29.44,29.24,28.93,28.94,28.6,28.24,27.11,26.84,26.27,26.07,25.01,26,25.8,25.8,25.89,26.46,26.86,25.79,25.29,25.11,24.79,25,25.66,25.5,26.58,26.32,26.37,26.44,25.95,25.77,25.31,25,24.53,24.31,23.31,23.01,23.16,23.27,23.27,23.82,24.3,24.41,24.27,24.83,25.13,25.44,25.51,24.89,25.23,25.48,25.12,25.84,25.81,26.1,26.16,25.95,26.03,25.81,26.33,26.16,25.73,25.37,25.55,25.61,25.07,24.86,24.49,24.4,24.5,24.71,24.82,24.44,24.23,24.28,24.04,24.1,23.82,23.93,23.64,23.46,23.9,23.94,24.29,24.29,23.96],
'High': [24.95,25.05,25.17,25.09,25.27,25.35,25.38,25.48,25.37,25.82,26.25,26.11,25.82,26.16,25.96,25.99,25.47,25.09,25.06,25.21,25.18,25.9,25.79,25.89,25.94,26.2,26.71,26.63,26.58,26.51,26.75,26.72,29.35,29.02,28.88,28.77,28.41,28.4,28.05,27.74,28.39,28.74,28.63,29,29.28,29.3,29.49,29.79,29.8,30,30.14,30,29.77,30.01,29.99,29.86,29.79,29.39,29.45,30.05,29.99,30.2,30.37,30.08,29.74,29.81,29.96,30,30.16,30.21,30.41,29.96,30.45,30.84,30.93,30.95,31,31,31.18,31.5,31.29,30.99,30.48,31.1,31.1,31.08,30.7,30.88,30.76,30.4,30.52,31.1,31.24,30.86,31.24,30.94,30.72,30.2,29.66,29.85,29.82,29.87,29.92,28.48,28.5,28.79,28.5,28.28,28.08,28.34,28.24,28.4,28.06,27.93,28.37,28.65,29.03,28.92,28.94,28.83,28.79,28.65,28.85,29.05,29.3,28.61,28.65,28.68,28.93,29.11,29.11,29.19,29.38,29.37,29.49,29.87,29.72,29.9,29.7,29.9,29.85,30.57,30.2,29.82,29.86,29.72,29.54,29.16,29.42,29.58,29.56,29.98,30.41,30.49,30.5,31,30.95,30.98,31.25,31.44,31.5,31.53,31.58,31.28,31.25,31,31.43,31.08,31.06,30.55,30.09,29.88,28.95,29.48,29.65,29.58,29.73,29.21,29.23,29,28.69,27.84,27.11,26.86,26.33,26.6,26.36,26.12,25.8,26.31,26.48,26.93,26.57,25.83,25.26,25.52,25.15,25.72,25.96,26.65,26.58,26.67,26.53,26.89,26.45,25.78,25.72,25.11,24.61,24.2,23.68,23.32,23.48,23.27,24.09,24.32,24.62,24.41,24.89,25.3,25.61,25.59,25.64,25.3,25.48,25.65,25.99,26.02,26.2,26.24,26.19,26.41,25.84,26.38,26.35,26.24,25.58,25.56,25.73,25.34,24.9,24.61,24.67,24.61,24.96,24.95,24.74,24.4,24.56,24.35,24.22,24.19,23.93,23.82,23.73,23.95,23.95,24.45,24.29,24.3],
'Low': [24.66,24.65,24.81,24.64,24.86,24.95,25.06,25.1,25.1,25.29,25.64,25.66,25.52,25.6,25.69,25.38,24.8,24.43,24.52,24.66,24.88,25.22,25.46,25.55,25.52,25.82,25.9,26.1,26.25,25.94,26.39,26.13,27.88,28.11,28.44,27.95,27.85,27.66,27.41,27.43,27.62,28.28,28.2,28.53,28.81,29.02,29,29.37,29.37,29.47,29.81,29.7,29.43,29.7,29.75,29.58,29.79,28.75,29,29.41,29.65,29.76,29.83,29.68,29.38,29.25,29.66,29.79,29.9,29.88,30.04,29.57,29.8,30.37,30.54,30.69,30.76,31,30.89,31.23,30.8,30.48,30.48,30.59,30.64,30.52,30.19,30.24,30.12,29.91,30.01,30.26,30.71,30.86,30.68,30.31,30,28.84,29.1,29.09,29.02,28.89,27.66,27.92,28.14,28.12,27.81,27.57,27.57,27.75,27.84,27.7,27.58,27.93,28.02,28.36,28.51,28.69,28.65,28.09,28.38,28.02,28.51,28.53,28.24,28.35,28.27,28.42,28.5,28.55,28.8,28.85,29.04,29.01,29.2,29.4,29.5,29.35,29.39,29.41,29.6,29.8,29.59,29.55,29.5,29.17,28.62,29.16,29.03,28.98,29.14,29.3,29.9,30.2,30.13,30.66,30.71,30.6,30.76,31.13,31.23,30.9,30.65,30.86,30.75,30.62,30.67,30.52,30.58,29.75,29.69,27.91,27.32,28.71,28.57,28.92,29.18,28.64,28.45,28.4,27.79,27.04,26.44,26.26,25.38,24.56,25.72,25.66,25.8,25.52,25.73,26.41,25.62,25.24,24.65,24.75,24.78,24.77,25.47,25.74,26.23,26.04,26.17,25.89,25.76,25.22,24.93,24.31,24.12,23.11,22.95,22.73,23.05,23.27,23.58,23.61,23.97,24.15,24.42,24.9,25.12,24.98,24.88,24.91,24.7,24.98,25.47,25.25,25.8,25.96,25.83,25.6,25.35,25.75,25.97,25.44,25.21,25.02,25.37,24.88,24.56,24.4,24.25,24.3,24.6,24.41,24.21,24.2,24.24,24.02,23.87,23.79,23.51,23.6,23.32,23.54,23.71,24.2,24.29,23.92],
'Volume': [49900235,46258757,54304284,42810156,44718408,50055778,42431643,68016403,28878663,61378342,60544519,56310695,50161051,44363585,39050278,63537684,75958097,51226259,60809818,48795241,38473856,60521239,39522259,29153569,37748964,45365489,65620101,56500866,48143163,54613476,61672603,61599926,281760947,124149662,69685783,73542323,65232886,73371734,62432606,50294715,63898306,52683314,38909997,57522019,65881036,49693320,55360706,53044975,54129501,75648887,59440915,51967660,42648018,41836365,37341362,32036164,0,29357892,44174645,49907182,36308524,43096326,58819960,38082612,37407912,44719350,45940703,43746588,34651154,49473151,55741169,43691182,94117968,40132875,36320920,28362689,11083867,0,25385575,29722450,42007597,31929611,0,38414185,49758862,58182332,50564285,51201289,68754648,65913228,51863463,63244767,79915648,0,46582886,54857712,73086701,102004573,63381173,66647676,63949492,117513692,193888424,85931099,54413654,61397848,77849968,80960063,52826474,59195742,48591246,65995913,81121515,0,51938098,45882842,42856501,44461634,36710350,52270044,43166875,48735294,40372889,43805302,93129838,48442081,42894184,56005054,39421396,50278457,44898608,35353651,31709321,37516750,36732935,50386698,43845199,81341090,37718162,42026555,33993584,73176624,55604731,33340722,34955871,63762620,74768063,0,34338235,47366786,58320552,63713716,54755457,37074279,41374514,68941186,52748075,88707802,64970248,52206093,55343086,84847551,126766583,63652231,68732315,64557901,52671781,63220209,43990036,82085579,66833778,128612951,173718024,86656268,63624802,47044237,45291598,63333959,46055496,52772107,61754173,87991056,117600229,73712018,98373509,176684012,136434525,67502221,0,76155453,65718772,67839372,89833275,80456154,87354921,87808432,78950407,68057774,50972363,81644277,48699364,47998692,52079257,54625218,55986386,61468282,85252196,156256672,73787879,119885791,81057995,92239399,62489452,0,73594554,81967278,50768072,53811348,49862201,61928666,72808022,56934631,65064760,38181760,45530162,73297593,73016369,108520012,67249812,60682484,69704731,69446188,83534777,55044515,56663784,78531804,64922012,55985489,57102542,87257683,76745824,70240460,45263430,40968392,52935026,46818826,54069035,49565732,51728126,66532358,47119791,49105276,60944493,45453037,66083495,65235852,48837044,64189016,0,51928618],
'5-day moving average': [,,,,,24.968,25.052,25.112,25.192,25.252,25.366,25.464,25.592,25.65,25.756,25.752,25.758,25.546,25.428,25.19,25.062,24.938,25.096,25.214,25.43,25.57,25.742,25.95,26.14,26.268,26.38,26.504,26.48,26.784,27.248,27.692,27.98,28.306,28.248,28.088,27.876,27.884,27.934,28.092,28.314,28.61,28.822,29,29.222,29.332,29.53,29.728,29.812,29.81,29.89,29.872,29.808,29.81,29.73,29.624,29.644,29.642,29.65,29.802,29.878,29.79,29.776,29.784,29.758,29.822,29.912,29.99,29.936,30.038,30.12,30.28,30.444,30.724,30.852,30.982,31.096,31.104,31,30.896,30.852,30.766,30.728,30.722,30.758,30.622,30.444,30.36,30.462,30.502,30.62,30.826,30.872,30.682,30.302,29.994,29.674,29.492,29.322,29.166,28.984,28.776,28.568,28.304,28.272,28.134,28.044,27.916,27.972,27.954,27.996,28.064,28.184,28.354,28.522,28.682,28.678,28.686,28.612,28.592,28.65,28.676,28.642,28.648,28.632,28.554,28.622,28.724,28.834,28.97,29.102,29.216,29.348,29.434,29.498,29.56,29.662,29.666,29.746,29.76,29.758,29.736,29.664,29.494,29.394,29.33,29.24,29.252,29.404,29.64,29.85,30.076,30.37,30.56,30.626,30.77,30.952,31.054,31.158,31.216,31.23,31.126,31.042,30.964,30.88,30.83,30.688,30.476,30.072,29.606,29.222,28.972,28.89,28.942,29.086,29.086,29.03,28.79,28.364,27.946,27.412,26.906,26.26,26.038,25.83,25.736,25.7,25.99,26.162,26.16,26.058,25.902,25.568,25.196,25.17,25.212,25.506,25.812,26.086,26.242,26.332,26.17,25.968,25.694,25.312,24.984,24.492,24.032,23.664,23.412,23.204,23.306,23.564,23.814,24.014,24.326,24.588,24.816,25.036,25.16,25.24,25.31,25.246,25.312,25.496,25.67,25.806,25.972,26.01,26.01,26.056,26.056,26.012,25.88,25.828,25.684,25.466,25.292,25.116,24.886,24.664,24.592,24.584,24.574,24.54,24.496,24.362,24.218,24.094,24.034,23.906,23.79,23.75,23.774,23.846,23.976],
'55-day moving average': [,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,26.97072727,27.06181818,27.14890909,27.22818182,27.30836364,27.39581818,27.47909091,27.56145455,27.64727273,27.72890909,27.798,27.87109091,27.94254545,28.02072727,28.09854545,28.17618182,28.25581818,28.34163636,28.43981818,28.54672727,28.65054545,28.75636364,28.85327273,28.95236364,29.05145455,29.15290909,29.24381818,29.31236364,29.38472727,29.46818182,29.55163636,29.62781818,29.698,29.746,29.77490909,29.80181818,29.84418182,29.894,29.95090909,30.00509091,30.07,30.11581818,30.14381818,30.15181818,30.15781818,30.16672727,30.17672727,30.17309091,30.14672727,30.12618182,30.09818182,30.07127273,30.036,30.00690909,29.96654545,29.932,29.89927273,29.86890909,29.84545455,29.81854545,29.78836364,29.76672727,29.75109091,29.72909091,29.70981818,29.68727273,29.66763636,29.64454545,29.62309091,29.60327273,29.57490909,29.54509091,29.52745455,29.49527273,29.46090909,29.42418182,29.38872727,29.35563636,29.32418182,29.29,29.25327273,29.22909091,29.21327273,29.19709091,29.17254545,29.15290909,29.13254545,29.12454545,29.10636364,29.094,29.08854545,29.06927273,29.03654545,29.00563636,28.97672727,28.94436364,28.922,28.92036364,28.94545455,28.96363636,28.98090909,29.00181818,29.03290909,29.07818182,29.126,29.17872727,29.22781818,29.29236364,29.34581818,29.40745455,29.45890909,29.512,29.56436364,29.61181818,29.66509091,29.69745455,29.72036364,29.72054545,29.71036364,29.71418182,29.72418182,29.73890909,29.75054545,29.75527273,29.75381818,29.75636364,29.75236364,29.72472727,29.69290909,29.65,29.60036364,29.52836364,29.47054545,29.40745455,29.344,29.28072727,29.22309091,29.17309091,29.104,29.02563636,28.93890909,28.85054545,28.75945455,28.68672727,28.61236364,28.55436364,28.50036364,28.44963636,28.40018182,28.33981818,28.27527273,28.20181818,28.11236364,28.00672727,27.89745455,27.76763636,27.62563636,27.48545455,27.35090909,27.20963636,27.07254545,26.94472727,26.81781818,26.69618182,26.582,26.47818182,26.37872727,26.27890909,26.17618182,26.07381818,25.98927273,25.90327273,25.84618182,25.80254545,25.75090909,25.70145455,25.638,25.57963636,25.52290909,25.47545455,25.43109091,25.38545455,25.35381818,25.33036364,25.31836364,25.30018182,25.29745455,25.27,25.24454545,25.22090909,25.19945455,25.16963636,25.12563636,25.09727273,25.07890909,25.05945455,25.04690909,25.02545455,24.994,24.96018182,24.90345455,24.85945455,24.81527273,24.77618182,24.746],
'Date': ['9-Sep-09','10-Sep-09','11-Sep-09','14-Sep-09','15-Sep-09','16-Sep-09','17-Sep-09','18-Sep-09','21-Sep-09','22-Sep-09','23-Sep-09','24-Sep-09','25-Sep-09','28-Sep-09','29-Sep-09','30-Sep-09','1-Oct-09','2-Oct-09','5-Oct-09','6-Oct-09','7-Oct-09','8-Oct-09','9-Oct-09','12-Oct-09','13-Oct-09','14-Oct-09','15-Oct-09','16-Oct-09','19-Oct-09','20-Oct-09','21-Oct-09','22-Oct-09','23-Oct-09','26-Oct-09','27-Oct-09','28-Oct-09','29-Oct-09','30-Oct-09','2-Nov-09','3-Nov-09','4-Nov-09','5-Nov-09','6-Nov-09','9-Nov-09','10-Nov-09','11-Nov-09','12-Nov-09','13-Nov-09','16-Nov-09','17-Nov-09','18-Nov-09','19-Nov-09','20-Nov-09','23-Nov-09','24-Nov-09','25-Nov-09','26-Nov-09','27-Nov-09','30-Nov-09','1-Dec-09','2-Dec-09','3-Dec-09','4-Dec-09','7-Dec-09','8-Dec-09','9-Dec-09','10-Dec-09','11-Dec-09','14-Dec-09','15-Dec-09','16-Dec-09','17-Dec-09','18-Dec-09','21-Dec-09','22-Dec-09','23-Dec-09','24-Dec-09','25-Dec-09','28-Dec-09','29-Dec-09','30-Dec-09','31-Dec-09','1-Jan-10','4-Jan-10','5-Jan-10','6-Jan-10','7-Jan-10','8-Jan-10','11-Jan-10','12-Jan-10','13-Jan-10','14-Jan-10','15-Jan-10','18-Jan-10','19-Jan-10','20-Jan-10','21-Jan-10','22-Jan-10','25-Jan-10','26-Jan-10','27-Jan-10','28-Jan-10','29-Jan-10','1-Feb-10','2-Feb-10','3-Feb-10','4-Feb-10','5-Feb-10','8-Feb-10','9-Feb-10','10-Feb-10','11-Feb-10','12-Feb-10','15-Feb-10','16-Feb-10','17-Feb-10','18-Feb-10','19-Feb-10','22-Feb-10','23-Feb-10','24-Feb-10','25-Feb-10','26-Feb-10','1-Mar-10','2-Mar-10','3-Mar-10','4-Mar-10','5-Mar-10','8-Mar-10','9-Mar-10','10-Mar-10','11-Mar-10','12-Mar-10','15-Mar-10','16-Mar-10','17-Mar-10','18-Mar-10','19-Mar-10','22-Mar-10','23-Mar-10','24-Mar-10','25-Mar-10','26-Mar-10','29-Mar-10','30-Mar-10','31-Mar-10','1-Apr-10','2-Apr-10','5-Apr-10','6-Apr-10','7-Apr-10','8-Apr-10','9-Apr-10','12-Apr-10','13-Apr-10','14-Apr-10','15-Apr-10','16-Apr-10','19-Apr-10','20-Apr-10','21-Apr-10','22-Apr-10','23-Apr-10','26-Apr-10','27-Apr-10','28-Apr-10','29-Apr-10','30-Apr-10','3-May-10','4-May-10','5-May-10','6-May-10','7-May-10','10-May-10','11-May-10','12-May-10','13-May-10','14-May-10','17-May-10','18-May-10','19-May-10','20-May-10','21-May-10','24-May-10','25-May-10','26-May-10','27-May-10','28-May-10','31-May-10','1-Jun-10','2-Jun-10','3-Jun-10','4-Jun-10','7-Jun-10','8-Jun-10','9-Jun-10','10-Jun-10','11-Jun-10','14-Jun-10','15-Jun-10','16-Jun-10','17-Jun-10','18-Jun-10','21-Jun-10','22-Jun-10','23-Jun-10','24-Jun-10','25-Jun-10','28-Jun-10','29-Jun-10','30-Jun-10','1-Jul-10','2-Jul-10','5-Jul-10','6-Jul-10','7-Jul-10','8-Jul-10','9-Jul-10','12-Jul-10','13-Jul-10','14-Jul-10','15-Jul-10','16-Jul-10','19-Jul-10','20-Jul-10','21-Jul-10','22-Jul-10','23-Jul-10','26-Jul-10','27-Jul-10','28-Jul-10','29-Jul-10','30-Jul-10','2-Aug-10','3-Aug-10','4-Aug-10','5-Aug-10','6-Aug-10','9-Aug-10','10-Aug-10','11-Aug-10','12-Aug-10','13-Aug-10','16-Aug-10','17-Aug-10','18-Aug-10','19-Aug-10','20-Aug-10','23-Aug-10','24-Aug-10','25-Aug-10','26-Aug-10','27-Aug-10','30-Aug-10','31-Aug-10','1-Sep-10','2-Sep-10','3-Sep-10','6-Sep-10','7-Sep-10'],
};
var msft_data_small = {
'Open': [24.74,24.8,24.93,24.65,24.97,25.25,25.06,25.46,25.11,25.4,25.92,25.92,25.69,25.6,25.91],
'Close': [24.78,25,24.86,25,25.2,25.2,25.3,25.26,25.3,25.77,25.69,25.94,25.55,25.83,25.75],
'High': [24.95,25.05,25.17,25.09,25.27,25.35,25.38,25.48,25.37,25.82,26.25,26.11,25.82,26.16,25.96],
'Low': [24.66,24.65,24.81,24.64,24.86,24.95,25.06,25.1,25.1,25.29,25.64,25.66,25.52,25.6,25.69],
'Volume': [49900235,46258757,54304284,42810156,44718408,50055778,42431643,68016403,28878663,61378342,60544519,56310695,50161051,44363585,39050278],
'5-day moving average': [,,,,,24.968,25.052,25.112,25.192,25.252,25.366,25.464,25.592,25.65,25.756],
'Date': ['9-Sep-09','10-Sep-09','11-Sep-09','14-Sep-09','15-Sep-09','16-Sep-09','17-Sep-09','18-Sep-09','21-Sep-09','22-Sep-09','23-Sep-09','24-Sep-09','25-Sep-09','28-Sep-09','29-Sep-09'],
};
var bardata = {
'AAPL': [1100000, -1200000, 1300000, 1400000],
'AMZN': [200000, null, 1400000, -1400000],
'GOOG': [1300000, -1500000, -1100000, -1150000],
'MSFT': [-1500000, 1100000, 1400000, -1000247],
'Quarter': ['Q1', 'Q2', 'Q3', 'Q4'],
};
var getRandomData = function (min, max, n, ints) {
var result = [];
for(i = 0; i < n; i++) {
var x = Math.random() * (max-min) + min;
if(ints) {
x = Math.round(x);
}
result.push(x);
}
return result;
}
var states = [];
for(state in Sai.data.map.us.paths) {
states.push(state);
}
var countries = [];
for(country in Sai.data.map.world.paths) {
countries.push(country);
}
var USdata = {
'__MAP__': Sai.data.map.us,
'states': states, // parallel to data arrays
'__DEFAULT__': 'TKOs',
'Banana Splits': [null, null, 1, 2, 3, null, 4, 5, 9, 1, 53, null, null, null, 1, 24, null, null, null, null, 54, 12, 34, null, null, null, null, 54, 12, 34, 34, null], // getRandomData(38.4, 38.7, states.length),
'TKOs': getRandomData(0, 1, states.length),
'Prisoners\' Dilemma Iterations': getRandomData(50, 150, states.length, true),
'Oatmeal Index': getRandomData(14, 31, states.length, true),
'Mathematician sightings': getRandomData(0, 10000000, states.length, true),
}
var WorldData = {
'__MAP__': Sai.data.map.world,
'countries': countries, // parallel to data arrays
'__DEFAULT__': 'TKOs',
'Banana Splits': getRandomData(38.4, 38.7, countries.length),
'TKOs': getRandomData(0, 1, countries.length),
'Prisoners\' Dilemma Iterations': getRandomData(50, 150, countries.length, true),
'Oatmeal Index': getRandomData(14, 31, countries.length, true),
'Mathematician sightings': getRandomData(0, 10000000, countries.length, true),
'Combo Breakers': getRandomData(2, 13, countries.length, true),
}
var UScolors = {
'Banana Splits': orange,
'TKOs': lilac,
'Prisoners\' Dilemma Iterations': olive,
'Oatmeal Index': ucla,
'Mathematician sightings': 'green',
'Combo Breakers': '#600',
}
var repubs = getRandomData(44, 56, states.length);
var dems = getRandomData(44, 56, states.length);
var greens = getRandomData(0, 0.5, states.length);
realData_repub = {
'HI': 27,
'AK': 60,
'FL': 48,
'NH': 45,
'MI': 41,
'VT': 31,
'ME': 40,
'RI': 35,
'NY': 36,
'PA': 44,
'NJ': 42,
'DE': 37,
'MD': 37,
'VA': 47,
'WV': 56,
'OH': 47,
'IN': 49,
'IL': 37,
'CT': 38,
'WI': 43,
'NC': 49,
'MA': 36,
'TN': 57,
'AR': 59,
'MO': 50.5,
'GA': 52,
'SC': 54,
'KY': 58,
'AL': 61,
'LA': 59,
'MS': 56,
'IA': 45,
'MN': 44,
'OK': 66,
'TX': 55,
'NM': 42,
'KS': 57,
'NE': 57,
'SD': 53,
'ND': 53,
'WY': 65,
'MT': 50.5,
'CO': 45,
'ID': 61,
'UT': 63,
'AZ': 54,
'NV': 43,
'OR': 41,
'WA': 41,
'CA': 37,
'DC': 23,
};
for(i = 0; i < states.length; i++) {
repubs[i] = realData_repub[states[i]];
dems[i] = 100 - repubs[i];
}
var USChromaticData = {
'__MAP__': Sai.data.map.us,
'Republican': repubs,
'Democrat': dems,
'Green Party': greens,
states: states
};
var USChromaticColors = {
'Republican': '#c00',
'Democrat': '#00c',
'Green Party': '#0f0',
};
var badMapData = {
"state": ["NJ", "ny", "dc", "ca", "ma", "md", "de", "pa", "ct", "il", "oh", "in", "ri", "mn", "ga", "mi", "va", "la", "wv", "tx", "wi", "ky", "tn", "or", "fl", "ut", "wa", "nc", "nh", "mo", "az", "co", "al", "sc", "ne", "ks", "ia", "nv", "ak", "ok", "ms", "vt", "id", "me", "nm", "nd", "sd", "mt", "wy"],
"Health Risk from Pollutants": [950.0, 940.0, 930.0, 890.0, 890.0, 870.0, 860.0, 860.0, 850.0, 800.0, 730.0, 720.0, 670.0, 660.0, 650.0, 640.0, 620.0, 590.0, 560.0, 550.0, 540.0, 540.0, 520.0, 520.0, 510.0, 500.0, 490.0, 480.0, 470.0, 460.0, 440.0, 440.0, 400.0, 390.0, 390.0, 360.0, 340.0, 340.0, 330.0, 330.0, 320.0, 270.0, 260.0, 240.0, 230.0, 200.0, 190.0, 180.0, 140.0],
"Toxic Chemical Emissions": [null, null, null, null, null, null, null, 110987443.0, null, null, 209090481.0, 136785790.0, null, null, 126580488.0, null, null, 120290949.0, null, 244460108.0, null, null, 148476319.0, null, 151374755.0, 173157779.0, null, 118729088.0, null, null, 328676277.0, null, 115716292.0, null, null, null, null, 496783770.0, 547987529.0, null, null, null, null, null, null, null, null, null, null],
'__MAP__': Sai.data.map.world,
'__DEFAULT__': "Toxic Chemical Emissions"
};
var badMapColors = {
"Health Risk from Pollutants": olive,
"Toxic Chemical Emissions": orange,
"state": ucla,
};
var irisData = {
'Sepal length': [5.1,4.9,4.7,4.6,5,5.4,4.6,5,4.4,4.9,5.4,4.8,4.8,4.3,5.8,5.7,5.4,5.1,5.7,5.1,5.4,5.1,4.6,5.1,4.8,5,5,5.2,5.2,4.7,4.8,5.4,5.2,5.5,4.9,5,5.5,4.9,4.4,5.1,5,4.5,4.4,5,5.1,4.8,5.1,4.6,5.3,5,7,6.4,6.9,5.5,6.5,5.7,6.3,4.9,6.6,5.2,5,5.9,6,6.1,5.6,6.7,5.6,5.8,6.2,5.6,5.9,6.1,6.3,6.1,6.4,6.6,6.8,6.7,6,5.7,5.5,5.5,5.8,6,5.4,6,6.7,6.3,5.6,5.5,5.5,6.1,5.8,5,5.6,5.7,5.7,6.2,5.1,5.7,6.3,5.8,7.1,6.3,6.5,7.6,4.9,7.3,6.7,7.2,6.5,6.4,6.8,5.7,5.8,6.4,6.5,7.7,7.7,6,6.9,5.6,7.7,6.3,6.7,7.2,6.2,6.1,6.4,7.2,7.4,7.9,6.4,6.3,6.1,7.7,6.3,6.4,6,6.9,6.7,6.9,5.8,6.8,6.7,6.7,6.3,6.5,6.2,5.9],
'Sepal width': [3.5,3,3.2,3.1,3.6,3.9,3.4,3.4,2.9,3.1,3.7,3.4,3,3,4,4.4,3.9,3.5,3.8,3.8,3.4,3.7,3.6,3.3,3.4,3,3.4,3.5,3.4,3.2,3.1,3.4,4.1,4.2,3.1,3.2,3.5,3.1,3,3.4,3.5,2.3,3.2,3.5,3.8,3,3.8,3.2,3.7,3.3,3.2,3.2,3.1,2.3,2.8,2.8,3.3,2.4,2.9,2.7,2,3,2.2,2.9,2.9,3.1,3,2.7,2.2,2.5,3.2,2.8,2.5,2.8,2.9,3,2.8,3,2.9,2.6,2.4,2.4,2.7,2.7,3,3.4,3.1,2.3,3,2.5,2.6,3,2.6,2.3,2.7,3,2.9,2.9,2.5,2.8,3.3,2.7,3,2.9,3,3,2.5,2.9,2.5,3.6,3.2,2.7,3,2.5,2.8,3.2,3,3.8,2.6,2.2,3.2,2.8,2.8,2.7,3.3,3.2,2.8,3,2.8,3,2.8,3.8,2.8,2.8,2.6,3,3.4,3.1,3,3.1,3.1,3.1,2.7,3.2,3.3,3,2.5,3,3.4,3],
'Petal length': [1.4,1.4,1.3,1.5,1.4,1.7,1.4,1.5,1.4,1.5,1.5,1.6,1.4,1.1,1.2,1.5,1.3,1.4,1.7,1.5,1.7,1.5,1,1.7,1.9,1.6,1.6,1.5,1.4,1.6,1.6,1.5,1.5,1.4,1.5,1.2,1.3,1.5,1.3,1.5,1.3,1.3,1.3,1.6,1.9,1.4,1.6,1.4,1.5,1.4,4.7,4.5,4.9,4,4.6,4.5,4.7,3.3,4.6,3.9,3.5,4.2,4,4.7,3.6,4.4,4.5,4.1,4.5,3.9,4.8,4,4.9,4.7,4.3,4.4,4.8,5,4.5,3.5,3.8,3.7,3.9,5.1,4.5,4.5,4.7,4.4,4.1,4,4.4,4.6,4,3.3,4.2,4.2,4.2,4.3,3,4.1,6,5.1,5.9,5.6,5.8,6.6,4.5,6.3,5.8,6.1,5.1,5.3,5.5,5,5.1,5.3,5.5,6.7,6.9,5,5.7,4.9,6.7,4.9,5.7,6,4.8,4.9,5.6,5.8,6.1,6.4,5.6,5.1,5.6,6.1,5.6,5.5,4.8,5.4,5.6,5.1,5.1,5.9,5.7,5.2,5,5.2,5.4,5.1],
'Petal width': [0.2,0.2,0.2,0.2,0.2,0.4,0.3,0.2,0.2,0.1,0.2,0.2,0.1,0.1,0.2,0.4,0.4,0.3,0.3,0.3,0.2,0.4,0.2,0.5,0.2,0.2,0.4,0.2,0.2,0.2,0.2,0.4,0.1,0.2,0.1,0.2,0.2,0.1,0.2,0.2,0.3,0.3,0.2,0.6,0.4,0.3,0.2,0.2,0.2,0.2,1.4,1.5,1.5,1.3,1.5,1.3,1.6,1,1.3,1.4,1,1.5,1,1.4,1.3,1.4,1.5,1,1.5,1.1,1.8,1.3,1.5,1.2,1.3,1.4,1.4,1.7,1.5,1,1.1,1,1.2,1.6,1.5,1.6,1.5,1.3,1.3,1.3,1.2,1.4,1.2,1,1.3,1.2,1.3,1.3,1.1,1.3,2.5,1.9,2.1,1.8,2.2,2.1,1.7,1.8,1.8,2.5,2,1.9,2.1,2,2.4,2.3,1.8,2.2,2.3,1.5,2.3,2,2,1.8,2.1,1.8,1.8,1.8,2.1,1.6,1.9,2,2.2,1.5,1.4,2.3,2.4,1.8,1.8,2.1,2.4,2.3,1.9,2.3,2.5,2.3,1.9,2,2.3,1.8],
'Species': ['Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-setosa','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-versicolor','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica','Iris-virginica'],
};
var irisColors = {
'Iris-setosa': orange,
'Iris-versicolor': gold,
'Iris-virginica': lilac,
};
var scatterMappings = {
color: 'Species',
x: 'Sepal length',
y: 'Petal width',
radius: 'Petal length',
// 'stroke_opacity': 'Sepal width',
'stroke_color': 'Sepal width',
};
var US2008data = {
'__MAP__': Sai.data.map.us,
Obama: [38.74043429,37.8893736,45.11525087,38.86465977,61.01263835,53.66023684,60.58882968,61.94266898,92.45710976,51.03330527,46.9901791,71.84611789,36.09594646,61.91811452,49.94591164,53.92802007,41.65196719,41.17063818,39.9329138,57.67197792,61.91934476,61.80156671,57.43129527,54.0602927,43.00155443,49.29264787,47.25246035,41.59826578,55.14667592,54.12689706,57.27213715,56.90748026,62.88346413,49.68587061,44.62054001,51.50427006,34.35491888,56.74880626,54.64039149,63.13150988,44.89656002,44.74743111,41.82853806,43.67917951,34.40574567,67.44198922,52.62946987,57.65289221,42.58975038,56.21778652,32.54089799],
McCain: [60.31691303,59.42451954,53.63524782,58.7159045,36.95485883,44.70752211,38.22146331,36.94703355,6.532557466,48.21531917,52.20451799,26.58168125,61.52554379,36.78092254,48.91390718,44.39325936,56.61225434,57.4025408,58.56272131,40.36039262,36.47451965,35.99024338,40.95831352,43.82293104,56.17618898,49.42607441,49.51567998,56.53185337,42.65411511,44.52142847,41.70393386,41.77903483,36.02743905,49.35712058,53.25010028,46.91057836,65.64508112,40.40098169,44.29258789,35.20702817,53.87364398,53.15897637,56.89695428,55.44735647,62.58386971,30.44304732,46.33050069,40.47630494,55.71034311,42.31366249,64.7762882],
Nader: [0.323265958,1.15972863,0.492745724,1.185514307,0.799157935,0.555934739,1.163595645,0.582184805,0.360349516,0.335178859,0.029507049,0.843313461,1.095366333,0.560411461,0.033041881,0.521363612,0.85178724,0.841934445,0.356851243,1.453817775,0.559090377,0.936096735,0.66146637,1.036019831,0.310962775,0.608948775,0.751822957,0.674669685,0.635430357,0.492707147,0.55058674,0.641685077,0.539849853,0.033577629,1.323032901,0.741667908,0,1.018347098,0.716733801,1.027956412,0.263044328,1.117088815,0.444658311,0.067339034,0.883690162,1.027030685,0.30841252,0.971030117,1.011842439,0.590095183,0.99152589],
State: ['AL','AK','AZ','AR','CA','CO','CT','DE','DC','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY']
};
var US2008ChromaticColors = {
McCain: '#f00',
Obama: '#00f',
Nader: '#0f0',
};
var gini_data = {
'Emerging Markets': [0.550,0.375,0.368,0.415,0.316,0.481,0.432,0.440,0.321,0.394,0.383,0.312,0.429,0.378,0.310,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000],
'Developed Markets': [0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.291,0.330,0.258,0.247,0.360,0.269,0.327,0.283,0.343,0.300,0.343,0.360,0.308,0.309,0.258,0.349,0.385,0.258,0.347,0.250,0.337,0.360,0.392,0.249,0.326,0.408,0.352,0.362],
'ISO': ['BR','RU','IN','CN','KR','MX','TR','PH','EG','ID','IR','PK','NG','VN','BD','AT','BE','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT','LU','NL','NO','PL','PT','SK','ES','SE','CH','GB','IL','JP','CA','US','AU','NZ'],
'__MAP__': Sai.data.map.world,
'__DEFAULT__': 'Developing Markets',
};
var gini_data_scatter = {
//'ISO': ['BR','RU','IN','CN','KR','MX','TR','PH','EG','ID','IR','PK','NG','VN','BD','AT','BE','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT','LU','NL','NO','PL','PT','SK','ES','SE','CH','GB','IL','JP','CA','US','AU','NZ'],
'Country': ['Brazil','Russia','India','China','South Korea','Mexico','Turkey','Philippines','Egypt','Indonesia','Iran','Pakistan','Nigeria','Vietnam','Bangladesh','Austria','Belgium','Czech Republic','Denmark','Estonia','Finland','France','Germany','Greece','Hungary','Ireland','Italy','Luxembourg','Netherlands','Norway','Poland','Portugal','Slovakia','Spain','Sweden','Switzerland','United Kingdom','Israel','Japan','Canada','United States','Australia','New Zealand'],
'GINI Coefficient': [0.550,0.375,0.368,0.415,0.316,0.481,0.432,0.440,0.321,0.394,0.383,0.312,0.429,0.378,0.310,0.291,0.330,0.258,0.247,0.360,0.269,0.327,0.283,0.343,0.300,0.343,0.360,0.308,0.309,0.258,0.349,0.385,0.258,0.347,0.250,0.337,0.360,0.392,0.249,0.326,0.408,0.352,0.362],
'Market type': ['Emerging','Emerging','Emerging','Emerging','Emerging','Emerging','Emerging','Emerging','Emerging','Emerging','Emerging','Emerging','Emerging','Emerging','Emerging','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed','Developed'],
//'GDP (millions)': [2023528,1476912,1430020,5745133,986256,1004042,729051,189061,216830,695059,337901,164792,206664,101987,105402,366259,461331,195232,304555,19220,231982,2555439,3305898,305005,132276,204144,2036687,52433,770312,413511,438884,223700,86262,1374779,444585,522435,2258565,201254,5390897,1563664,14624184,1219722,138003],
//'Population': [190732694,141914509,1194140000,1342360000,48501000,112322757,73722988,94013200,79801000,237556363,75078000,171850000,158259000,86930000,150058000,8396760,10827519,10515818,5560628,1340127,5379000,65821885,81802000,11306183,10014324,4470700,60545940,502100,16648800,4939000,38092000,10636888,5433385,46152925,9412851,7782900,61792000,7697600,127370000,34356000,312072000,22564000,4400700],
'Population (log10)': [8.28,8.15,9.08,9.13,7.69,8.05,7.87,7.97,7.90,8.38,7.88,8.24,8.20,7.94,8.18,6.92,7.03,7.02,6.75,6.13,6.73,7.82,7.91,7.05,7.00,6.65,7.78,5.70,7.22,6.69,7.58,7.03,6.74,7.66,6.97,6.89,7.79,6.89,8.11,7.54,8.49,7.35,6.64],
//'GDP': [2023528000000,1476912000000,1430020000000,5745133000000,986256000000,1004042000000,729051000000,189061000000,216830000000,695059000000,337901000000,164792000000,206664000000,101987000000,105402000000,366259000000,461331000000,195232000000,304555000000,19220000000,231982000000,2555439000000,3305898000000,305005000000,132276000000,204144000000,2036687000000,52433000000,770312000000,413511000000,438884000000,223700000000,86262000000,1374779000000,444585000000,522435000000,2258565000000,201254000000,5390897000000,1563664000000,14624184000000,1219722000000,138003000000],
//'GDP (log10)': [12.31,12.17,12.16,12.76,11.99,12.00,11.86,11.28,11.34,11.84,11.53,11.22,11.32,11.01,11.02,11.56,11.66,11.29,11.48,10.28,11.37,12.41,12.52,11.48,11.12,11.31,12.31,10.72,11.89,11.62,11.64,11.35,10.94,12.14,11.65,11.72,12.35,11.30,12.73,12.19,13.17,12.09,11.14],
'GDP per capita': [10609.24,10407.05,1197.53,4279.87,20334.76,8938.90,9889.06,2011.00,2717.13,2925.87,4500.67,958.93,1305.86,1173.21,702.41,43619.09,42607.27,18565.56,54769.89,14341.92,43127.35,38823.55,40413.41,26976.83,13208.68,45662.65,33638.70,104427.40,46268.32,83723.63,11521.68,21030.59,15876.29,29787.47,47231.70,67126.01,36551.09,26145.03,42324.70,45513.56,46861.57,54056.11,31359.33]
};
var gini_scatter_mappings = {
color: 'Market type',
x: 'GINI Coefficient',
y: 'GDP per capita',
radius: 'Population (log10)',
};
var gini_scatter_colors = {
'Emerging': orange,
'Developed': ucla
}
var badSmallData = {MSFT: [1], "GOOG": ["alert('hi')"], "junk": [null], "AAPL": [2]};
var linebreaker = {"category": "line", "title": "", "footnote": "SOURCE: Eurostat", "data": {"oct": ["nov", "dec", "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep"], "108.41": [108.54000000000001, 108.88, 108.05, 108.39, 109.37, 109.87, 110.01000000000001, 110.02, 109.65000000000001, null, null]}, "height": 350, "DEFAULT": "108.41", "type": "line", "label": "oct", "optional": {"area": true, "line_size": "2", "axis": {"right": [], "left": ["oct", "108.41"]}}, "width": 350, "color": {"oct": "#429380", "108.41": "#A8502C"}};
var r1 = Raphael("c1", 350, 350);
var chart = new Sai.LineChart(r1, 0, 350, 350, 350, data2, "Month", {bgcolor: tea, interactive: true, groups: {left: ['AAPL', 'GOOG', 'MSFT'], right: ['AMZN']}}).setColors(colors).render();
var r2 = Raphael("c2", 350, 350);
var stackedchart = new Sai.StreamChart(r2, 0, 350, 350, 350, data, "Month", {simple: 0, bgcolor: tea, title: "Monthly average adjusted close", interactive: true, stacked: true, area: true, lineWidth: 1}).render();
var r3 = Raphael("c3", 350, 350);
var stockchart = new Sai.StockChart(r3, 0, 350, 350, 350, msft_data, "Date", {simple: 0, bgcolor: tea, title: "MSFT (NASDAQ)"}).setColors({'5-day moving average': olive, '55-day moving average': ucla}).render();
var r4 = Raphael("c4", 350, 350);
var barc = new Sai.BarChart(r4, 0, 350, 350, 350, bardata, "Quarter", {simple: 0, bgcolor: tea, title: "Some titled bar chart", interactive: true}).setColors(colors).render(true);
var r5 = Raphael("c5", 350, 350);
var sbarc = new Sai.BarChart(r5, 0, 350, 350, 350, data2, "Month", {simple: 0, bgcolor: tea, interactive: true, stacked: true, title: "stacked bar chart"}).setColors(colors).render(true);
var r6 = Raphael("c6", 800, 650);
//var worldchart = new Sai.ChromaticGeoChart(r6, 0, 650, 800, 650, gini_data, "ISO", {simple: 0, bgcolor: tea, title: "GINI Coefficients", interactive: true, ignoreZeroes: true, fromWhite: true}).setColors({'Developed Markets': ucla, 'Emerging Markets': orange}).render();
var r7 = Raphael("c7", 400, 350);
var uschromaticchart = new Sai.ChromaticGeoChart(r7, 0, 350, 400, 350, US2008data, "State", {simple: 0, bgcolor: tea, title: "2008 Election", interactive: true, groupedNormalization: true}).setColors(US2008ChromaticColors).render();
var r8 = Raphael("c8", 400, 350);
var sp = (new Sai.ScatterChart(r8, 0, 350, 400, 350, irisData, "", {simple: 0, mappings: scatterMappings, bgcolor: tea, title: "Fisher's Iris Data", colors: irisColors, stroke_colors: [orange, ucla], interactive: true})).render();
var r9 = Raphael("c9", 600, 600);
var sp = (new Sai.ScatterChart(r9, 0, 600, 600, 600, gini_data_scatter, "", {mappings: gini_scatter_mappings, bgcolor: tea, title: "GINI, GDP per capita, Population in EMs and DMs", colors: gini_scatter_colors, interactive: true})).render();
}
</script>
</body>
</html>