-
Notifications
You must be signed in to change notification settings - Fork 0
/
columnchart.html~
62 lines (42 loc) · 1.4 KB
/
columnchart.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
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
//var button = document.getElementById('b1');
function drawChart() {
// Disabling the button while the chart is drawing.
// button.disabled = true;
// google.visualization.events.addListener(chart, 'ready',
// function() {
// button.disabled = false;
// });
var data = google.visualization.arrayToDataTable([
['Year', 'Sales', 'Expenses'],
['2004', 1000, 400],
['2005', 1170, 460],
['2006', 660, 1120],
['2007', 1030, 540]
]);
var options = {
title: 'Company Performance',
hAxis: {title: 'Year', titleTextStyle: {color: 'red'}}
};
var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
// button.onclick = function() {
// var newValue = 1000 - data.getValue(0, 1);
//data.setValue(0, 1, newValue);
//drawChart();
// }
drawChart();
}
</script>
</head>
<body>
<div id="chart_div" style="width: 900px; height: 500px;"></div>
<li id="b1"> button </li>
</body>
</html>