Page 1 of 1

Google Charts API

Posted: Wed Jan 21, 2009 10:08 pm
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.

Google Charts API

Posted: Wed Jan 21, 2009 11:38 pm
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