Trying to show two charts, one geo, one stacked area. For some reason can't 
seem to get both to show up simultaneously. They both work, depending on 
which I label drawChart2 (this is the variable that doesn't work).

<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 drawChart2() {
        var data = google.visualization.arrayToDataTable([
              ["State","Percent of High School Graduates Going Directly to 
College"],
              ["Alabama",63.2],
              ["Alaska",46.4],
              ["Arizona",57.9],
              ["Arkansas",65.4],
              ["California",61.7],
              ["Colorado",61.2],
              ["Connecticut",78.7],
              ["Delaware",47.3],
              ["Florida",63.1],
              ["Georgia",67.7],
              ["Hawaii",63.6],
              ["Idaho",45.1],
              ["Illinois",58.7],
              ["Indiana",65.8],
              ["Iowa",66.6],
              ["Kansas",64.7],
              ["Kentucky",62.9],
              ["Louisiana",64.7],
              ["Maine",56.2],
              ["Maryland",64.1],
              ["Massachusetts",73.2],
              ["Michigan",61.9],
              ["Minnesota",70.9],
              ["Mississippi",78.8],
              ["Missouri",61.4],
              ["Montana",60.5],
              ["Nebraska",69.5],
              ["Nevada",51.8],
              ["New Hampshire",64.3],
              ["New Jersey",68.6],
              ["New Mexico",72.4],
              ["New York",68.9],
              ["North Carolina",64.1],
              ["North Dakota",67.4],
              ["Ohio",61.5],
              ["Oklahoma",60.2],
              ["Oregon",47.8],
              ["Pennsylvania",60.9],
              ["Rhode Island",65.4],
              ["South Carolina",68.3],
              ["South Dakota",71.8],
              ["Tennessee",62.1],
              ["Texas",56.2],
              ["Utah",53.3],
              ["Vermont",53.5],
              ["Virginia",63.8],
              ["Washington",48.3],
              ["West Virginia",59.2],
              ["Wisconsin",60.1],
              ["Wyoming",60.4]
        ]);

        var options = {
          region: 'US',
          resolution: 'provinces'
        };

        var chart = new 
google.visualization.GeoChart(document.getElementById('first'));
        chart.draw(data, options);
    }
    
    function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['College Enrollement and Work Activity for Class of 2013', 
 'White', 'Black','Asian','Hispanic'],
          ['Recent High School Graduates', 2224,415,177,571],
          ['Enrolled in College',1493,246,140,342],
          ['Not Enrolled in College and in Labor Force',561,114,18,146],
          ['Recent High School Dropouts',406,84,15,135]
        ]);

        var options = {
          vAxis: {title: 'Population (in thousands)'},
          isStacked: true
        };

        var chart = new 
google.visualization.SteppedAreaChart(document.getElementById('secondchart'));
        chart.draw(data, options);
      }
      
      function drawVisualization() {
               drawChart();
               drawChart2();
          }
    </script>
  </head>
  <body>
    <h1>High School Graduates going directly to college</h1>
    <p>While most states are sending around 50-60% of students to college 
directly it was interesting to see how the Pacific Northwest has a 
relatively low rate, which might be due to careers there not needing 
advanced degrees or that students are taking time off between high school 
and college.</p>
    <div id="first" style="width: 900px; height: 500px;"></div>

<h1>What Students do after High School</h1>
<p>It further looks like there is a discrepancy between races when we look 
at what students are doing after high school, whether it is graduating or 
dropping out. Black and Hispanic students are less likely to attend college 
than Whites and especially Asians.</p>
<div id="secondchart" style="width: 900px; height: 500px;"></div>
<p></p><a href="http://www.bls.gov/news.release/hsgec.nr0.htm";>Source: 
Bureau of Labor Statistics</a>
  </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/d/optout.

Reply via email to