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:
Create the
ch09/GoogleCharts
folder.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>
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...