Labels

php (35) javascript (31) phpjavascript (30) jquery (23) html (20) mysql (14) database (9) codeigniter (4) json (4) bar chart (2) calendar (2) column chart (2) framework (2) google maps (2) query (2) tables (2) url (2) dropdown (1)

Wednesday, February 21, 2018

Everything about google pie chart

Its always a good idea to represent your data in a graphical way. here we are explaining how to use google graphs API.
<html>
  <head>
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">
      google.charts.load('current', {'packages':['corechart']});
      google.charts.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>
  </head>
  <body>
    <div id="piechart" style="width: 900px; height: 500px;"></div>
  </body>
</html>

Add these lines in your options variable

1. For 3D model pie chart.
is3D: true,

2. Adding background to pie chart
backgroundColor: 'skyblue',

3. Change legend text color and size
legendTextStyle: { color: 'red', fontSize: 15},

4. Change legend position
you can four different position options-top/bottom/left/right
legend:{ position:'bottom'},

5. Change title text color and size
titleTextStyle: { color: 'red', fontSize:16},

6. Change colors of pie slices
 colors: ['#e0440e', '#e6693e', '#ec8f6e', '#f3b49f', '#f6c7b6'],

7. Pie slice text display value and percentage
only for value.
 pieSliceText: 'value',

only for percentage
 pieSliceText: 'percentage',

for value and percentage
 pieSliceText: 'value-and-percentage',

8.Change pie slice(labels) text color and size
pieSliceTextStyle : {fontSize:16, color:'red'},
Result:



22 comments:

  1. It is always so hard to express how we feel and sometimes it is almost impossible to make others understand what we feel for them. The standards are often too high to attain. So many things to say, but not enough words. So, how do we create an atmosphere of pure emotion, love and affection? How do we send a message without actually saying too much? How do we reflect humility, tradition and respect without overstepping our bounds? These questions drive us every day.

    cheap flowers singapore
    best florist singapore
    cheap florist singapore
    flower arrangements online
    flower bouquet same day delivery
    flower delivery websites
    online floral delivery
    bridal hand bouquet singapore
    singapore florist delivery online
    flowers for floral arrangements
    Same day flower delivery singapore

    ReplyDelete
  2. Enter into norton setup with Norton setup product key. Sign in to download or setup. How to install Norton Security at norton setup Get Started.

    norton.com/setup
    www.norton.com/setup
    norton.com/setup
    norton setupnorton.com/setup

    norton.com/setup
    norton.com/setup
    norton setup
    www.norton.com/setup
    norton.com/setup


    ReplyDelete
  3. norton setup - Have you purchased a Norton security product recently? Find out how to download, install, setup Norton antivirus on your device.

    WWW.norton.com/setup

    norton.com/setup

    norton setup

    norton.com/NU16

    WWW.norton.com/NU16

    norton NU16

    norton account

    norton my account

    norton.com/myaccount

    ReplyDelete
  4. McAfee Complete McAfee Endpoint Protection is one of the many products of McAfee and the first choice for all businesses, depending on the sizes.


    mcafee.com/activate

    www.mcafee.com/activate

    mcafee activate

    mcafee.com/activate

    www.mcafee.com/activate

    ReplyDelete
  5. Install webroot antivirus with key code to remove threats without cd. if you want more info call our webroot install number.

    ReplyDelete
  6. To enable the protection for your Windows or Mac PC, all you need to do is download, install and activate the Norton Setup.

    norton setup - Have you purchased a Norton security product recently? Find out how to download, install, setup Norton antivirus on your device.

    WWW.norton.com/setup

    norton.com/setup

    norton setup

    norton.com/NU16

    WWW.norton.com/NU16

    norton NU16

    norton account

    norton my account

    norton.com/myaccount

    ReplyDelete

  7. One can buy Norton from retail store or online. Now Symantec has started distributing product activation keys in the form of retail card.

    norton.com/setup
    www.norton.com/setup
    norton com setup
    norton setup
    norton.com setup


    norton setup
    www.norton.com/setup
    norton.com/setup

    ReplyDelete
  8. MS Office setup at www.office.com/setup. Sign in with your Microsoft account or create one, enter your product key and install Office 365 or office 2016.

    ReplyDelete
  9. norton account offers you a fee-based suite of antivirus product that helps users to protect . it will protect your computer like avenger protect the

    earth from alien.

    WWW.norton.com/setup

    norton.com/setup

    norton setup

    norton.com/NU16

    WWW.norton.com/NU16

    norton NU16

    norton account

    norton my account

    norton.com/myaccount

    ReplyDelete
  10. Mcafee Activate: Are you facing the trouble to download, install and activate the McAfee product to the device? Follow the stepwise procedure detailed here for successfully activating the McAfee subscription using the redeemed McAfee Activation License Keycode.

    http://mcafee.coms-activate.me/

    ReplyDelete
  11. Call at Avast customer service number to get instant technical support for Avast antivirus. Resolve avast renewal problems, activation, billing problems etc.

    ReplyDelete
  12. Norton Setup is enhanced its versions to safeguard the information from any style of malware.

    norton.com/setup
    norton setup

    ReplyDelete
  13. Aol Mail is a free web-based email service provided by AOL, If you want Aol Login but you stuck log in don't worry we will help you and troubleshoot issues.

    ReplyDelete
  14. Need help for microsoft office setup? We can set-up, configure, & customize the suite as you want. office setup tech expert are 24*7 help you.

    Related Keywords:

    Office.com/setup
    www.office.com/setup
    office setup

    ReplyDelete
  15. McAfee Complete McAfee Endpoint Protection is one of the many products of McAfee and the first choice for all businesses, depending on the sizes.

    mcafee activate

    ReplyDelete

  16. Norton.com/Setup - Guide how to download, install, and activate www.norton.com/setup on your device. Also get complete information about Norton antivirus.

    norton.com/setup
    norton setup

    ReplyDelete
  17. Norton.com/setup - Norton offers highly-advanced security solutions and antivirus range to the computer users across the world.

    norton.com/setup

    norton.com/NU16

    ReplyDelete
  18. 24/7 technical support for Install Webroot antivirus, call us to get instant support on Webroot Install issues. if you face any problem Dial Webroot toll free number.

    ReplyDelete
  19. Are you face any problem regarding AOL Mail Account then you can easily contact our AOL Mail Support Service Number. Our technical support provide better facility by calling 24*7 service, to get resolved and hence to fix the errors at an immediate point.

    ReplyDelete
  20. norton.com/nu16- Step-by-step procedure for downloading, installing, and activating your Norton Setup antivirus successfully.

    norton.com/nu16

    ReplyDelete

More Posts

FOLLOW