-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdataVis.html
49 lines (40 loc) · 1.17 KB
/
dataVis.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
<html>
<head>
<script type="text/javascript"
src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['corechart']}]}"></script>
</head>
<body>
<div id="piechart" style="width: 900px; height: 500px;"></div>
<script>
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Aerospace', 47],
['Mechanical', 29],
['Computer', 2],
['Physics', 1],
['Architecture', 18],
['Bussiness', 7]
]);
var options = {
title, 'Major Department'
}
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
var counter = 0;
var handler = setInterval(function () {
counter = counter + 0.1
options = {
title: 'Majors',
slices: {
1: { offset: counter },
3: { offset: counter },
5: { offset: counter },
}
};
chart.draw(data, options);
if (counter > 0.3) clearInterval(handler);
}, 200);
}
</script>
</body>