ponjohsays
Cool! Bookmarked and appreciated =) Hehe I hadn’t bought anything on Envato until the PHP Scripts category came along =P
ponjohsays
Cool! Bookmarked and appreciated =) Hehe I hadn’t bought anything on Envato until the PHP Scripts category came along =P
garibensays
Looking cool.
What data do you need to create the graphs?
just table data in cvs/txt/xls format, upload to Google, and it generates the graph? or am I getting it all wrong?
Thanks
freekraisays
Thanks ponjoh 
gariben, You put the data in a PHP array, and the class does the work of sending it to google, handling caching, etc.
Idea is that you just had to set up your array containing your data and the class does the rest.
It’s been working well on every project I’ve used it on, so I figured I’d let others make use of it too.
I also have a version that is purely javascript, minus the caching, just haven’t finished the documentation to upload it here yet.
Twadesays
Amazing work, has been planning to do this for envato but you beat me to it
Looks really good though! Can see it being very useful on sites.
keithvsays
Is there a way to save the resulting graphic to your server? Or do you have to reference an image on Google’s server?
Thanks!
freekraisays
keithv, the file that is saved by the cacher function is the png file saved to your hard drive, I have saving as a .txt file and being read out via the cache system, but you can also have it save it straight as a png file.
soremitesays
Works great.
If you use godaddy hosting add php5 to the extentions and check inside the files for any php references.
freekraisays
@soremite, what sort of godaddy hosting account do you have?
I haven’t had a server there for a while (moved them to mediatemple and slicehost), but I’ve never had to add php5 to the extension before ever, and all my files were php5.
Slepisays
Hello freekrai,
Is it possible to have this script converted into a CakePHP component with minimal efforts?
For example, since you implemented caching in this script, will it be difficult to customize it so that the caching system complies to the file/folder-structure conventions used by CakePHP?
Thanks.
freekraisays
@Slepi, as it is now, can set in it’s own folder and be called by a CakePHP script, to convert it into a full CakePHP component would be a rewrite of pretty much the whole system, and then would only work for CakePHP.
In its current form, it can be used on any website that has PHP , and is not limited just to one framework, and I myself would rather leave it that way.
jeffeatworldsays
Hi
Great littel php snippet here, makes it so much simpler especailly things like the dimension and choosing colours.
I have a quiestion – How do you change the encoding? I asking becuase I have values taht are often over 100 adn I think simple encoding only goes up to 100 
I’ve yet to try it with database results but I’m assuming that too will work like a charm…
I’ve had some users on DBStract with pretty long values.
I’ve had it handling over 100 characters pretty easily. base64_encode’s only limitation that I’ve run into is with IE6 , where it could only handle up to 2000 characters.
You can change it to something else, but base64 definitely handles more than 100 characters.
Cheers, taking a real basic example I literally just changed the first entry in $dataMultiple which is for Feb 2008 > IE7 from 22 to 200 to see it would scale – that’s what I’m talking about.
I read this page – http://code.google.com/apis/chart/formats.html#scaled_values
I’m wondering how to adjust the script for scaling?
bafadamsays
I’ll just safely assume you didn’t go back and add the scaling options to the views.
cfoinfosays
has this been updated to take advantage of Google’s new interactive charts (e.g. more data about pie segment on click)?
COPYRIGHT (C) 2010 ENVATO| TERMS OF USAGE| SUPPORT/HELP| ICONS BY TANGO + WEFUNCTION + FAMFAMFAM
Adobe®, Flash®, Flex®, Fireworks®, Photoshop®, Illustrator®, InDesign® and After Effects® are registered trademarks of Adobe Systems Incorporated.
14comments