1

i have following code to display pie chart.

<script>
google.charts.load('current', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawChart);
//google.charts.setOnLoadCallback(drawChartTwo);
//google.charts.setOnLoadCallback(drawChartThree);
// 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 = google.visualization.arrayToDataTable([
  ['Type', 'Duration'],
  <?php
      foreach($val as $data){
        echo "['".$data['type']."', ".$data['duration']."],";
     }
  ?>
]);

// Set chart options
var options = {'title':'Duration Analysis',
               'width':830,
               'height':300,
               'is3D': true,
               pieSliceText : 'none',
               };

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

and its working fine. but, now when i see chart on my browser i see it like. enter image description here

in the image i see list of values in pagination with 3 page. but i want it to display right side of my chart without pagination. any possibility to display 3 colomns instead of 3 pagination page??? Please help me.

Deep 3015
  • 9,929
  • 5
  • 30
  • 54
Divyesh Jesadiya
  • 1,105
  • 4
  • 30
  • 68
  • only thing you can really do is make the chart taller / legend text smaller -- or build the legend yourself, [here is an example](https://stackoverflow.com/a/36064828/5090771) – WhiteHat May 25 '17 at 12:14

0 Answers0