chart.html

chart - Amit Tomer, 2014-01-30 09:36

Download (930 Bytes)

 
1
<html>
2
  <head>
3
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
4
    <script type="text/javascript">
5
      google.load("visualization", "1", {packages:["corechart"]});
6
      google.setOnLoadCallback(drawChart);
7
      function drawChart() {
8
        var data = google.visualization.arrayToDataTable([
9
          ['Year', 'Sales', 'Expenses'],
10
          ['2004',  1000,      400],
11
          ['2005',  1170,      460],
12
          ['2006',  660,       1120],
13
          ['2007',  1030,      540]
14
        ]);
15

16
        var options = {
17
          title: 'Company Performance',
18
          hAxis: {title: 'Year', titleTextStyle: {color: 'red'}}
19
        };
20

21
        var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
22
        chart.draw(data, options);
23
      }
24
    </script>
25
  </head>
26
  <body>
27
    <div id="chart_div" style="width: 900px; height: 500px;"></div>
28
  </body>
29
</html>