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
/* ------------------------------------------------------------------------------
*
* # Google Visualization - rotated pie
*
* Google Visualization rotated pie chart demonstration
*
* Version: 1.0
* Latest update: August 1, 2015
*
* ---------------------------------------------------------------------------- */
// Rotated pie chart
// ------------------------------
// Initialize chart
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawPieRotated);
// Chart settings
function drawPieRotated() {
// Data
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Work', 11],
['Eat', 2],
['Commute', 2],
['Watch TV', 2],
['Sleep', 7]
]);
// Options
var options_pie_rotate = {
fontName: 'Roboto',
pieStartAngle: 180,
height: 300,
width: 500,
chartArea: {
left: 50,
width: '90%',
height: '90%'
}
};
// Instantiate and draw our chart, passing in some options.
var pie_rotate = new google.visualization.PieChart($('#google-pie-rotate')[0]);
pie_rotate.draw(data, options_pie_rotate);
}