-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcloudsetting_stats.html
81 lines (70 loc) · 3.21 KB
/
cloudsetting_stats.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
<html>
<head>
<!-- use google's version of jquery.js instead of a local copy -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
<script type="text/javascript">
// Get list of ViewportBackgroundColor items from rhinotest database
var vpbackground_data;
var commandprompt_data;
$(document).ready( function()
{
var url = "https://stevebaer.cloudant.com/rhinotest/_design/test/_view/ViewportBackgroundColor?group=true&callback=?";
$.getJSON(url,
function(data){
vpbackground_data = data;
});
url = "https://stevebaer.cloudant.com/rhinotest/_design/test/_view/CommandPromptBackgroundColor?group=true&callback=?";
$.getJSON(url,
function (data) {
commandprompt_data = data;
});
});
</script>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create our data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'ViewportBackgroundColor');
data.addColumn('number', 'Count');
for (var i = 0; i < vpbackground_data.rows.length; i++) {
data.addRow([vpbackground_data.rows[i].key, vpbackground_data.rows[i].value]);
}
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('viewport_background_chart_div'));
var _c = new Array();
for (var i = 0; i < vpbackground_data.rows.length; i++) {
_c[i] = vpbackground_data.rows[i].key;
}
chart.draw(data, { width: 600, height: 400, is3D: true, title: "Viewport background color", colors: _c });
data = new google.visualization.DataTable();
data.addColumn('string', 'CommandPromptBackgroundColor');
data.addColumn('number', 'Count');
for (var i = 0; i < commandprompt_data.rows.length; i++) {
data.addRow([commandprompt_data.rows[i].key, commandprompt_data.rows[i].value]);
}
chart = new google.visualization.PieChart(document.getElementById('command_prompt_background_chart_div'));
_c = new Array();
for (var i = 0; i < commandprompt_data.rows.length; i++) {
_c[i] = commandprompt_data.rows[i].key;
}
chart.draw(data, { width: 600, height: 400, is3D: true, title: "Command prompt background color", colors: _c });
}
</script>
</head>
<body>
<!--Div that will hold the pie chart-->
<h1>Appearance Settings Summary</h1>
<div id="viewport_background_chart_div"></div>
<hr />
<div id="command_prompt_background_chart_div"></div>
</body>
</html>