We have moved at community.getvera.com

Author Topic: Google Chart Tools  (Read 2619 times)

Offline utz

  • Sr. Member
  • ****
  • Posts: 274
  • Karma: +0/-0
Google Chart Tools
« on: June 19, 2011, 01:02:25 pm »
I would like to use Google Chart Tools on one of the device tabs. It is possible to use java script on tabs so I guess it should work in general. Google Chart tools require to load an AJAX API before you can use it and I wonder how to do that. Basically, I wonder where the line "<script type="text/javascript" src="https://www.google.com/jsapi"></script>" should go. Did anyone try this before (With or without success)?

I can log sensor data in a text file on the system and I can download it then and make nice graphs. However, I would like to see some sensor data charts directly in the dashboard and thought I could use Google Charts to read and present whats in the text files.



Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Google Chart Tools
« Reply #1 on: June 19, 2011, 05:37:45 pm »
Google Chart tools require to load an AJAX API before you can use it and I wonder how to do that.

I considered it for the CurrentCost EnviR plugin, but decided to go with the simpler Image Chart API, mostly for the reason you mention.

While searching, I did see some suggestions that you could use DOM manipulation to insert (local-to-Vera copies of) the Google Chart JavaScript files into the current document's <head> when your tab's JavaScript loads.  It all seemed a bit precarious.

Offline utz

  • Sr. Member
  • ****
  • Posts: 274
  • Karma: +0/-0
Re: Google Chart Tools
« Reply #2 on: June 20, 2011, 12:57:38 pm »
Agreed, the simpler Image Chart API is the way to go. I looked at the CurrentCost EnviR plugin and this is what I was looking for.

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: Google Chart Tools
« Reply #3 on: June 20, 2011, 06:03:30 pm »
Not quite what you're looking for, but http://code.matthewwild.co.uk/gchart/summary might be of interest.

Offline utz

  • Sr. Member
  • ****
  • Posts: 274
  • Karma: +0/-0
Re: Google Chart Tools
« Reply #4 on: June 20, 2011, 06:48:45 pm »
Not quite what you're looking for, but http://code.matthewwild.co.uk/gchart/summary might be of interest.

Yes that is a good hint; that is the sort of thing I am looking at. (I am not familiar with UIs; things I normally deal with do not have user interfaces)