title: How to Align a Google Chart in WebView?
body: <p>My google chart is not aligned in the center of my android emulator screen. When activity loads up, I get this: </p>
  
  <p><a href="https://i.stack.imgur.com/AM3o5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AM3o5.png" alt="android emulator image"></a></p>
  
  <p>How can I put the chart in the center of the screen? I tried some css, and xml solutions found on stack but they brought no result. </p>
  
  <p>Here is the code I used:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;!--Load the AJAX API--&gt;
  &lt;script type="text/javascript" src="https://www.google.com/jsapi"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
    google.load('visualization', '1.0', {'packages':['corechart']});
  
    google.setOnLoadCallback(drawChart);
  
    function drawChart() {
  
    // Create the data table.
    var data = new google.visualization.DataTable();
    data.addColumn('string', 'ITEM');
    data.addColumn('number', 'VALUE');
    data.addRows([
      [Android.getName(0), Android.getPoint(0)],
      [Android.getName(1), Android.getPoint(1)],
      [Android.getName(2), Android.getPoint(2)],
      [Android.getName(3), Android.getPoint(3)],
      [Android.getName(4), Android.getPoint(4)]
    ]);
  
    // Set chart options
    var options = {'title':'You Have a GREAT Music Taste',
                   pieHole: 0.4,
                   width: '100%',
                   height: '750'
                   };
  
    // Instantiate and draw our chart, passing in some options.
    var chart = new 
   google.visualization.PieChart(document.getElementById('chart_div'));
    chart.draw(data, options);
    google.visualization.events.addListener(chart, 'select', selectHandler);
  
    function selectHandler() {
        var selection = chart.getSelection();
        var message = '';
        for (var i = 0; i &lt; selection.length; i++) {
          var item = selection[i];
          if (item.row != null &amp;&amp; item.column != null) {
            var str = data.getFormattedValue(item.row, item.column);
            message += '{row:' + item.row + ',column:' + item.column + '} = ' 
  + str + '\n';
          } else if (item.row != null) {
            var str = data.getFormattedValue(item.row, 0);
            message += '{row:' + item.row + ', column:none}; value (col 0) = ' 
  + str + '\n';
          } else if (item.column != null) {
            var str = data.getFormattedValue(0, item.column);
            message += '{row:none, column:' + item.column + '}; value (row 0) 
  = ' + str + '\n';
          }
        }
        if (message == '') {
          message = 'nothing';
        }
        Android.sendData('You selected ' + message);
     }
  
  }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;!--Div that will hold the pie chart--&gt;
  &lt;div id="chart_div" style="width:500; height:500"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>