Google charts eliminate space from column chart - Javascript Google Chart

Javascript examples for Google Chart:Column Chart

Description

Google charts eliminate space from column chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['corechart', 'bar']}]}"></script> 
      <div id="chart_div"></div> 
      <script type="text/javascript">
google.setOnLoadCallback(drawBasic);/*from  w  ww.  j  ava2  s .  c  o  m*/
function drawBasic() {
    var data = new google.visualization.DataTable();
    data.addColumn('string', 'Time of Day');
    data.addColumn('number', 'Motivation Level');
    data.addRows([
        ["6/4/2015", 10],
        ["13/4/2015", 10],
        ["7/4/2015", 20],
        ["14/4/2015", 10],
        ["8/4/2015", 10], ]);
    var chart = new google.visualization.ColumnChart(
    document.getElementById('chart_div'));
    var options = {
        bar: {
            groupWidth: "99%"
        },
    };
    chart.draw(data, options);
}

      </script>  
   </body>
</html>

Related Tutorials