How to add Google Charts to your web page?

CSSWeb DevelopmentFront End Technology

To add Google Charts to your web page, the code is as follows −


 Live Demo

<!DOCTYPE html>
<title>Google Charts Tutorial</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
   google.charts.load("current", { packages: ["corechart"] });
   .barchartContainer {
      width: 550px;
      height: 400px;
      margin: 0 auto;
      font-weight: bold;
   body {
      font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
<h1 style="text-align: center;">
Adding google charts to your web page Example
<div class="barchartContainer"></div>
<script language="JavaScript">
   function drawChart() {
      var data = google.visualization.arrayToDataTable([
         ["Year", "India"],
         ["2013", 500],
         ["2014", 800],
         ["2015", 1000],
         ["2016", 1200],
         ["2017", 1400]
      var options = { title: "Educated people(in millions)" };
      var chart = new google.visualization.BarChart(
      chart.draw(data, options);


The above code will produce the following output −

Published on 12-May-2020 17:06:47