google.charts.load(‘current’, {‘packages’:[‘corechart’]}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn(‘string’, ‘Member’); data.addColumn(‘number’, ‘Score’); data.addRows([ [‘Christopher’, 7], [‘Ramiro’, 6], [‘Eduards’, 5], [‘Kul’, 4], [‘Larry’, 3], [‘David’, 2], [‘Yanyan’, 1] ]); var options = {‘title’:’Webtech chocolate consumption’, ‘width’:400, ‘height’:300}; var chart = new google.visualization.PieChart(document.getElementById(‘chart_div’)); chart.draw(data, options); }
0 comments on “Google Charts API example” Add yours →