Page 1 of 1

Google chart API

Posted: Thu Dec 02, 2010 6:13 am
by klevis miho
Has anyone used google charts api?

If yes, and if you know how to work with it, what am I doing wrong in displaying the Y-axis:

http://chart.apis.google.com/chart?chxs ... est6|Test7

Re: Google chart API

Posted: Sat Dec 25, 2010 3:53 am
by Darhazer
You can go http://code.google.com/intl/bg-BG/apis/ ... izard.html, paste your URL and play with the editor
In your case you have to add the chxr param - axes range.

Re: Google chart API

Posted: Mon Dec 27, 2010 9:00 am
by thecodewall
Hi! I use Google Chart for my web application, here's my simple code, you can use this as your guide.

Code: Select all

<html> 
  <head> 
    <script type="text/javascript" src="http://www.google.com/jsapi"></script> 
    <script type="text/javascript"> 
      google.load("visualization", "1", {packages:["columnchart"]}); 
      google.setOnLoadCallback(drawChart); 

      function drawChart() { 
        var data = new google.visualization.DataTable(); 
       	data.addColumn('string', 'Course'); 
	data.addColumn('number', 'AB'); 
	data.addColumn('number', 'ABCO'); 
	data.addColumn('number', 'ABID'); 
	data.addColumn('number', 'ABMC'); 
	data.addColumn('number', 'ABPO');
        data.addRows(1); 
        data.setValue(0, 1, 179); 
        data.setValue(0, 2, 78); 
        data.setValue(0, 3, 291); 
        data.setValue(0, 4, 34); 
        data.setValue(0, 5, 101); 

        var chart = new google.visualization.ColumnChart(document.getElementById('chart_div')); 
        chart.draw(data, {width: 400, height: 250, is3D: true, legend: 'right', logScale:false}); 
      } 

    </script> 

  </head> 
  <body style="padding:0px; margin:0px;">
    <div id="chart_div" align="center"></div> 
  </body> 
</html>