problem in displaying pie chart

17 views
Skip to first unread message

sk

unread,
May 29, 2012, 2:51:15 PM5/29/12
to google-visua...@googlegroups.com
i want display all the sector in the pie but it only displaying 2...plz help me


google.load('visualization', '1',{'packages': [ 'corechart']});

      function drawColumnChart() {

        var query = new google.visualization.Query(
            'https://docs.google.com/spreadsheet/ccc?key=0ArFGfpB6duBGdFpSa2s0TEliUlVBVWdDbEs2N0ttNnc#gid=0');
        query.send(draw);
      }

      function draw(response) {
        if (response.isError()) {
          alert('Error in query');
        }

        var data = response.getDataTable();
        var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
        chart.draw(data, {'isStacked': true, 'legend': 'bottom','vAxis': {'title': ''}});

      }
function drawPieChart(){
                var queryP = new google.visualization.Query(
              'https://docs.google.com/spreadsheet/ccc?key=0ArFGfpB6duBGdFpSa2s0TEliUlVBVWdDbEs2N0ttNnc#gid=0' );
     
           queryP.send(handleQueryResponse);
       }

       function handleQueryResponse(response) {
         if (response.isError()) {
           alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
           return;
         }

         var dataP = response.getDataTable();
        var chart1 = new google.visualization.PieChart(document.getElementById('pie_div'));
         chart1.draw(dataP);
    }
function drawVisualization(){
drawColumnChart();
drawPieChart();

}
  google.setOnLoadCallback(drawVisualization);



Jinji

unread,
May 30, 2012, 9:07:16 AM5/30/12
to google-visua...@googlegroups.com
I tried your example, but I don't have permissions to access the spreadsheet. Please either provide permissions, or create an example that doesn't query the spreadsheet.





--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/TE3ivN-L0zAJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

Reply all
Reply to author
Forward
0 new messages