Book Image

Sencha Charts Essentials

By : Ajit Kumar
Book Image

Sencha Charts Essentials

By: Ajit Kumar

Overview of this book

Table of Contents (16 chapters)
Sencha Charts Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Google Charts


Google Charts is a data visualization library from Google. It renders charts using SVG and VML (for older IE versions), and offers cross-platform portability to iPhones, iPads, and Android.

Let's follow these steps to create the desired chart using Google Charts:

  1. Create the ch09/GoogleCharts folder.

  2. Create the index.html file and save the following code in it:

    <html>
      <head>
        <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    
        <script type="text/javascript" src="app.js"></script>
      </head>
    
      <body>
        <div id="chartdiv" style="width:600; height:500"></div>
      </body>
    </html>
  3. Create the app.js file and save the following code in it:

    google.load('visualization', '1.0', {'packages':['corechart']});
    
    // Set a callback to run when the Google Visualization API is loaded.
    google.setOnLoadCallback(drawChart);
    
    function drawChart() {
    
            var data = new google.visualization.arrayToDataTable...