-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultChartsSingFunc.html
More file actions
48 lines (42 loc) · 1.65 KB
/
multChartsSingFunc.html
File metadata and controls
48 lines (42 loc) · 1.65 KB
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
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
// Load Charts and the corechart and barchart packages.
google.charts.load('current', {'packages':['corechart']});
// Draw the pie chart and bar chart when Charts is loaded.
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
['Mushrooms', 3],
['Onions', 1],
['Olives', 1],
['Zucchini', 1],
['Pepperoni', 2]
]);
var piechart_options = {title:'Pie Chart: How Much Pizza I Ate Last Night',
width:400,
height:300};
var piechart = new google.visualization.PieChart(document.getElementById('piechart_div'));
piechart.draw(data, piechart_options);
var barchart_options = {title:'Barchart: How Much Pizza I Ate Last Night',
width:400,
height:300,
legend: 'none'};
var barchart = new google.visualization.BarChart(document.getElementById('barchart_div'));
barchart.draw(data, barchart_options);
}
</script>
<body>
<!--Table and divs that hold the pie charts-->
<table class="columns">
<tr>
<td><div id="piechart_div" style="border: 1px solid #ccc"></div></td>
<td><div id="barchart_div" style="border: 1px solid #ccc"></div></td>
</tr>
</table>
</body>
</html>