Pie chart problem

28 views
Skip to first unread message

Fabio Giugliano

unread,
Jul 29, 2016, 1:26:19 PM7/29/16
to Google Visualization API
This is the graph:

<html>
  <head>
    <!--Load the AJAX API-->
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">

      // Load the Visualization API and the corechart package.
      google.charts.load('current', {'packages':['corechart']});

      // Set a callback to run when the Google Visualization API is loaded.
      google.charts.setOnLoadCallback(drawChart);

      // Callback that creates and populates a data table,
      // instantiates the pie chart, passes in the data and
      // draws it.
      function drawChart() {

        // Create the data table.
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Topping');
        data.addColumn('number', 'Slices');
        data.addRows([
          ['Success', 260],
          ['Failure', 3836],
        ]);

        // Set chart options
        var options = {'title':'Bomb clip angle',
                       'width':400,
                       'height':300,
                       pieStartAngle: 158,};

        // Instantiate and draw our chart, passing in some options.
        var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
  </head>

  <body>
    <!--Div that will hold the pie chart-->
    <div id="chart_div"></div>
  </body>
</html>

I was wondering if there was any way to display that:
At the north point of the graph, there's the number 1161
At the east point of the graph, there's the number 647
At the south point of the graph, there's number 3709
At the west point of the graph, there's number 2685
The 2 edges of the slice "Success", you have numbers 3705 and 3965 (in fact the whole slice is 260).

I didn't find anything about how to put specific numbers in specific points of the pie chart...
Regards, Fabio

Fabio Giugliano

unread,
Jul 29, 2016, 1:33:00 PM7/29/16
to Google Visualization API
By the way, that chart is about angles that are displayed from 0 to 4096, counterclockwise. 0 should be somewhere on the down-right.
Reply all
Reply to author
Forward
0 new messages