Hi All, I am new here. I use google charts also to display charts on my 
webpage. Great feature. 

I try to display multiple charts on 1 page, bar, combo, line, etc. 
Currently I have 4 charts on my webpage, 1 bar, 1 combo and 2 line charts. 
3 of them are displayed on my page, the last one, a line chart, is not 
displayed. I can't figure out why. Can anyone help me. My code is below.

Thanks in advanced!!


<html>
<head>
<META HTTP-EQUIV="Window-target" content="_blank">
<meta http-equiv="PRAGMA" content="NO-CACHE">
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=iso-8859-1">
<TITLE>Test</TITLE>
<LINK rel="stylesheet" href="http://ssp-secure.dll.corp/sitestyle.css"; 
TYPE="text/css">   
<style TYPE="text/css"> 
<!--                                                                       
            
.title        {font-family: Verdana, Arial; font-size: 10pt; color: 
#990000; font-weight: bold}
.subtitle     {font-size: 9pt; color: #000; font-weight: bold}
.myArea       {font-size: 10pt; color: #000; font-weight: bold;} 
p             {margin:0; margin-bottom:5px;}
body          {font-family:Arial;font-size:12px;}
.subtitle     {font-weight:bold; }
#myNews       {background-color:#6699CC;}
.left         {float:left; width:50%; padding:0 10px; }
.right        {float:right; width:50%; padding:0 10px; }
.altarea      {background-color:#F0F0F0; border:5px solid #fff; 
width:603px;}
.area         {background-color:#fff; border:5px solid #fff; width:603px;}
.myArea       {padding-left:15px;  }
.newsTable {margin:0; padding:5px; }
-->
.hiddenControl {display:none}
</STYLE>
<!--Load the AJAX API--> 
 <script type="text/javascript" 
src="https://www.gstatic.com/charts/loader.js";></script> 
 <script 
src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js";></script>
 <script type="text/javascript"> 

google.charts.load('43', {packages: ['corechart', 'bar', 'line']});

google.charts.setOnLoadCallback(drawCharts); 

function drawCharts() { 

     // CREATE THE DATA TABLE. 
 var data = google.visualization.arrayToDataTable([ 
['Month', 'Column1', 'Column2', 'Column3','Column4' ],
 ['201504',57.15,84.37, 281.2, 0], 
 ['201505',79.91,255.67, 217.57, 0], 
 ['201506',19.09,309.78, 293.79, 0], 
 ['201507',0,142.31, 90.15, 0], 
 ['201508',74.76,400.77, 120.04, 0], 
 ['201509',0,587.43, 0, 0] 
     ]);    

 var data2 = new google.visualization.DataTable(); 
 data2.addColumn('string', 'Month');
 data2.addColumn('number', 'Numbers');

 data2.addRows([ 
 ['201504',3], 
 ['201505',2], 
 ['201506',4], 
 ['201507',5], 
 ['201508',2] 
     ]);    

 var data3 = google.visualization.arrayToDataTable([ 
['Month', 'Numbers', 'Average' ],
 ['201504',10,10 ], 
 ['201505',12,11 ], 
 ['201506',9,10.33 ], 
 ['201507',10,10.25 ], 
 ['201508',11,10.4 ], 
 ['201509',4,9.33] 
     ]);    

 var data4 = new google.visualization.DataTable(); 
 data4.addColumn('string', 'Month');
 data4.addColumn('number', 'Average');

 data4.addRows([ 
 ['201502',719.96 ], 
 ['201503',846.84 ], 
 ['201504',1643 ], 
 ['201505',1406.4 ], 
 ['201506',1255.38 ], 
 ['201508',1384.81 ], 
 ['201509',1370.5] 
     ]); 

     // Set chart options 
     var options = { 
         width: 500, 
         height: 250, 
         legend: { position: 'top', maxLines: 3 }, 
         bar: { groupWidth: '75%' }, 
         isStacked: true 
     };

     var options2 = { 
         width: 500, 
         height: 250, 
         legend: { position: 'none' }  
     };

     var options3 = { 
         width: 500, 
         height: 250, 
         legend: { position: 'none' },  
         vAxis: {title: 'Amount'}, 
         hAxis: {title: 'Month'}, 
         seriesType: 'bars', 
         series: {1: {type: 'line'}} 
     };

     var options4 = { 
         width: 500, 
         height: 250, 
         legend: { position: 'none' }  
     };

     var chart = new 
google.visualization.ColumnChart(document.getElementById('columnchart1'));
     chart.draw(data, options); 

     var chart2 = new 
google.charts.Line(document.getElementById('linechart2'));
     chart2.draw(data2, options2); 

     var chart3 = new 
google.visualization.ComboChart(document.getElementById('combochart3'));
     chart3.draw(data3, options3); 

     var chart4 = new 
google.charts.PieChart(document.getElementById('linechart4'));
     chart4.draw(data4, options4); 

   } 
</script>
</head>
<BODY>
<table>
<tr>
<td><div id="columnchart1"></div></td>
<td><div id="linechart2"></div></td>
</tr>
<tr>
<td><div id="combochart3"></div></td>
<td><div id="linechart4"></div></td>
</tr>
</TABLE>
</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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/ac749065-7f38-4ee6-aa60-62051d7365cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to