I have a question about whether it is possible to embed two GoogleCharts 
into one HTML code. If so are there any tricks?  Here is my unsuccssful 
attempt at it.  Please advise.


<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);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Month', 'Hostile Deaths', 'Non-Hostile Deaths'],
          
          ['Jan',  78,      5],
          ['Feb',  70,      11],
          ['Mar',  71,       10],
          ['Apr',  96,      8],
          ['May',  120,      6,],
          ['Jun',  93,      8],
          ['Jul',  67,       13],
          ['Aug',  56,      28],
          ['Sept',  43,      23],
          ['Oct',  29,      9],
          ['Nov',  27,       9],
          ['Dec',  14,      9,]
        ]);

        var options = {
          title: 'Operation Iraqi Freedom US Military Deaths, 2007',
          backgroundColor: ['#999999'],
           colors:['#cc0000','#ff6600'],
          tooltip: {isHtml: true}

        };

  var cha
        var chart = new 
google.visualization.LineChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    
    </script>
    
        <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Month', 'Hostile Deaths', 'Non-Hostile Deaths'],
          
          ['Jan',  8,      8],
          ['Feb',  11,      6],
          ['Mar',  4,       5],
          ['Apr',  13,      6],
          ['May',  11,      13],
          ['Jun',  10,      5],
          ['Jul',  5,       3],
          ['Aug',  4,      3],
          ['Sept',  4,      6],
          ['Oct',  2,      7],
          ['Nov',  2,       9],
          ['Dec',  0,      3,]
        ]);

        var options = {
          title: 'Operation Iraqi Freedom US Military Deaths, 2009',
          backgroundColor: ['#999999'],
           colors:['#cc0000','#ff6600'],
          tooltip: {isHtml: true}
        };

  var cha
        var chart = new 
google.visualization.LineChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
    
  </head>
  <body>
    <div id="chart_div" style="width: 400px; height: 500px;"></div>
  </body>
</html>



-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to