I have a chart compliant json 
{"cols":[{"label":"name","type":"string"},{"label":"count","type":"number"}],"rows":[{"c":[{"v":"Name"},{"v":1}]},{"c":[{"v":"Name1"},{"v":2}]},{"c":[{"v":"Name2"},{"v":3}]},{"c":[{"v":"Name4"},{"v":1}]}]}
 
which I want to display as Google Chart on my sceen. using ajax call I am 
able to form the foll code:

<script>
$(document).ready(function(){
    google.load('visualization', '1', {
        packages: ['corechart']
    });


    function drawBasic(d) {
      var data = new google.visualization.DataTable(d);
      var options = {
         title: 'Sample Data',
         hAxis: {
            title: 'Name'
         },
         vAxis: {
            title: 'Count'
         },
         width: 400,
         height: 240
      };


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


    $.ajax({
        url : "Serv",
        dataType: 'json',
         contentType: 'application/json',
        success : function(result) {
          google.setOnLoadCallback(drawBasic(JSON.stringify(result)));
        },
        complete: function(){
           // whatever..
        }
    });


 });
</script>
but still I am unable to display the data.

jsbin link: http://jsbin.com/hofaqidape/2/watch?html,js,output 
<http://jsbin.com/hofaqidape/2/watch?html,js,output> . This is what I am 
trying to do dynamically. could somebody help me.

Thanks :)

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to