Google Charts API

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

Post Reply
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Google Charts API

Post by RDNZL »

It's real easy to use google's charts inside DomotiGa/Gambas.

With just a few lines like this:

Code: Select all

        sUrl = Subst("http://chart.apis.google.com/chart?chs=165x90&cht=gom&chco=0000ff99,ffffff99,ff000099&chd=t:&1&chl=&2", rDevice!value * 3, rDevice!value & rDevice!label)
        hDownloadImage = NEW HttpClient AS "Download"
        hDownloadImage.URL = sUrl
        hDownloadImage.Async = FALSE
        hDownloadImage.TimeOut = 5
        hDownloadImage.Get()

        IF hDownloadImage.Status < 0 THEN
          IF Main.bMainDebug THEN Main.WriteDebugLog("[Climate] Error downloading image " & sUrl)
        ELSE
          ' success - read the data
          IF Lof(hDownloadImage) THEN READ #hDownloadImage, sDownload, Lof(hDownloadImage)
          File.Save(sTempFile, sDownload)
          TRY pbOutsideTemp.Picture = Picture.Load(sTempFile)
          IF Exist(sTempFile) THEN KILL sTempFile
        END IF
Look at the new home screenshot to get an idea.
http://www.domotiga.nl/projects/domotig ... a-home.jpg

Anyone using them too in their program?
Looking for a nice one for 24hr power usage chart.

Regards,
Ron.
Mdamen
Forum Moderator
Forum Moderator
Posts: 390
Joined: Sat Nov 22, 2008 6:58 pm
Location: Netherlands
Contact:

Google Charts API

Post by Mdamen »

I've been looking into the google charts api, however the main disadvantage is for me: no internet connection, no charts.

--
Maarten Damen

www.maartendamen.com
Post Reply

Return to “DomotiGa Forum”