alimertaytar
alimertaytar

Reputation: 105

Google Pie Charts Label

http://j1309.hizliresim.com/1f/v/t1ux0.png

Thats my chart and my code;

<script type="text/javascript">
  google.load("visualization", "1", {packages:["corechart"]});
  google.setOnLoadCallback(drawChart);
  function drawChart() {

    var data = google.visualization.arrayToDataTable([
      ['Task', 'Hours per Day'],
      ['Work',     11],
      ['Eat',      2],
      ['Commute',  2],
      ['Watch TV', 2],
      ['Sleep',    7]
    ]);

    var options = {
      title: 'My Daily Activities'

    };

    var chart = new google.visualization.PieChart(document.getElementById('piechart'));
    chart.draw(data, options);
  }
</script>

how can i make my labels like that picture. i want it shows values outside of chart

http://o1309.hizliresim.com/1f/v/t1uy7.png

Upvotes: 3

Views: 9279

Answers (1)

seobility
seobility

Reputation: 159

Use in your options:

var options = {
  title: 'My Daily Activities',
  legend: {position: 'labeled'}
};

More Information here: https://google-developers.appspot.com/chart/interactive/docs/gallery/piechart

Upvotes: 9

Related Questions