2013-01-22 40 views
0

我有这样的谷歌可视化,我想希它我的浏览器窗口全屏:http://cl.ly/image/1y0U1m1o2m0m谷歌可视化整个浏览器窗口

的代码是:

<html> 
    <head> 
    <meta charset="utf-8"> 
    <title> 

    </title> 
    <script type="text/javascript" src="http://www.google.com/jsapi"></script> 
    <script type="text/javascript"> 
     google.load("jquery", "1.4.2"); 
     google.load('visualization', '1', {packages: ['corechart']}); 
    </script> 
    <script type="text/javascript"> 
     function drawVisualization() { 
     // Create and populate the data table. 
     var a = <?=$elos?>; 
     var data = google.visualization.arrayToDataTable(a); 

     var options = { 
      title: 'blah blah blah', 
      //curveType: "function", 
      width: $(window).width(), 
      height: $(window).height(), 
      vAxis: { 
      minValue:800, 
      maxValue:2000, 
      textStyle: {color: 'black'} 
      }, 
      legend:{position: 'none'} 
     }; 



     // Create and draw the visualization. 
     new google.visualization.LineChart(document.getElementById('visualization')). 
      draw(data, options); 
     } 

     google.setOnLoadCallback(drawVisualization); 
    </script> 
    </head> 
    <body> 
    <div id="visualization"></div> 
    </body> 
</html> 

即使它被设置为窗口大小和它创建窗口大小的RECT有很多自由空间的图表

回答

0

为了使图表是整页的面积约为:

chartArea: {width: '90%', height: '90%'} 
相关问题