32

I would like to use the Google Chart API in one of my project.

Is it possible to download ONE JavaScript for it so that I can work offline?

I tried to download the script referred from the html page (jsapi) and its code seems to load up other scripts:

google.loader.ServiceBase = 'https://www.google.com/uds';
google.loader.GoogleApisBase = 'https://ajax.googleapis.com/ajax';
...

Is there no way to get just one unified JavaScript?

2 Answers 2

41

Working offline with Google Chart API is not permitted, since it is against their TOS.

3
  • So even if I manage to download all the code and use it offline I would be breaking the law? Mar 23, 2014 at 19:49
  • 5
    Google is not as "open source" as they would have you believe. Some of their stuff is still proprietary. Jun 8, 2014 at 23:23
  • 4
    I came to same problem, As this question is too old, just for reference, here i am adding link of google FAQs... Answer: They don't provide Google Charts Offline.. developers.google.com/chart/interactive/faq Go to this question: Can I use charts offline? Jul 11, 2015 at 3:56
12

Download this package: https://www.dropbox.com/s/4cd7zbdvv2mlg8f/gstatic.zip?dl=0

After add this code in HTML:

<script type="text/javascript" src="gstatic/loader.js"></script>

This works for me.

It is to see version 44 of Google chart

7
  • Hey Alorse hope you are well. May you please tell me how can , I use the chart offline. May you please tell me which css or js and fonts , I need to add in my html page from the package that link you mentioned here and their order. Oct 3, 2016 at 11:18
  • The only file that must include is the loader.js, as I indicated in solving the issue, do not include any CSS or anything else.
    – Alorse
    Oct 4, 2016 at 16:29
  • 2
    So does doing this violate Google terms and conditions or not?
    – RobPio
    Nov 28, 2016 at 22:26
  • 4
    Just what we need, to be advising people to do things we are unsure of the legality of...
    – Michael
    Apr 7, 2018 at 5:02
  • 4
    @RobPio Yes, using the Google charts offline, explicitly violates Google terms and condition. It is written in their TOS, here is a quote: "Sorry; our terms of service do not allow you to download and save or host the google.charts.load or google.visualization code. However, if you don't need the interactivity of Google Charts, you can screenshot the charts and use them as you wish.". Here is a link: developers.google.com/chart/interactive/faq#localdownload
    – Jacob
    Nov 13, 2018 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.