Google Charts - Environment Setup


Advertisements

In this chapter we will discuss about how to set up Google Charts library to be used in web application development.

Install Google Charts

There are two ways to use Google Charts.

  • Download − Download it locally from https://developers.google.com/chart and use it.

  • CDN access − You also have access to a CDN. The CDN will give you access around the world to regional data centers that in this case, Google Chart host https://www.gstatic.com/charts.

Using Downloaded Google Chart

Include the googlecharts JavaScript file in the HTML page using following script −

<head>
   <script src = "/googlecharts/loader.js"></script>
</head>

Using CDN

We are using the CDN versions of the Google Chart library throughout this tutorial.

Include the Google Chart JavaScript file in the HTML page using following script −

<head>
   <script src = "https://www.gstatic.com/charts/loader.js"></script>
</head>
Advertisements