Back to Top

How to use Google Visualization Chart for Your Data

Updated 22 November 2013

This is very easy to use Google Visualization Chart for your data to show amazing way to analyse your result

Here is the simple code implementation and you can use this code in any programming language .

There having various Google chart you can use here is the Pie Chart representation of your data.

Code:

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Sale', 'Hours per Day'],
	  ['Hammer',14],['Nice Saw',13],
          ['Hand Shovel heavy duty',10],
          ['Shovel',6],['Circular Saw',6],
          ['Plastic Ladder',5],['Chain Saw',5],
          ['Hand Shovel cheap',4],
          ['Metal Ladder',4],
          ['Hand Shovel enforced',2],
          ['Drill',2],['Wooden Ladder',1],
          ['Smaller Shovel',1],			  
        ]);
        var options = {
          title: 'Top Selling Product'
        };

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

<div id="piechart-topproduct" style="width: 900px; height: 500px; float:left;"></div>

Display the Data like this

Start your headless eCommerce
now.
Find out More

top products

 

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home