Google has a nice charting API that lets you send data to it and returns an image that you can use on your site.
But some of their formatting can be a little complicated.
This PHP script lets you include charts on your websites powered by the google charts API .
This plugin handles all calls to google and even includes caching.
This plugin is in use on DBStract and Surveyti.me as well as several other projects and serves it’s purpose well.
Includes a sample index.php file that contains a couple different styles of charts to show how to get started.
You must sign in or sign up to purchase this item.
Download Price: $5
This Product Download Buyers Review:
Cool! Bookmarked and appreciated =) Hehe I hadn’t bought anything on Envato until the PHP Scripts category came along =PDownload PHP Scripts Google Charts Plugin CodeCanyon FreePHP Scripts | charts,
Download Price: $5
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?
ThanksImages and Media | data visualization,
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.google chart,
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.google chart integration,
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!graphs,
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.
Works great.
If you use godaddy hosting add php5 to the extentions and check inside the files for any php references.
@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.
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.
@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.
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?
Scale and encoding are 2 different things
will doublecheck when I get home, as I am currently visiting in-laws
Cool. Any joy? No rush but I imagine other folks would like to know too.
I’m actually working on having scale get handled automatically, and adding in a few extra encoding options. I forget why I switched from e to t, but you will be able to switch between e,t or s very shortly.
Scaling is going to be done automatically, and is already running in the demo without any problems.
Sounds great mate, let me know when it’s ready looking forward to it.
Chees.
Any updates?
I just got back from a vacation with my wife and daughter, so I wasn’t exactly able to do any development work. Catching up on stuff now, and then getting back to finishing what I started.
Any news bro? Been a while since I last asked I figured you might have it sorted by now?…
It’s in the update queue, should be available to you guys shortly
Cheers – whats the update queue?
I’ll just safely assume you didn’t go back and add the scaling options to the views.
I thought they got added, it’s been a hectic year. Let me check my code in the morning to see what version is on here.
has this been updated to take advantage of Google’s new interactive charts (e.g. more data about pie segment on click)?
Excellent plugin and I will buy the extended version now as it fits in my application that I sell nicely.
Quick question – Is it ready to use interactive charts as shown here:http://code.google.com/apis/charttools/docs/choosing.html
If not, could you help how I can integrate these charts in your code?
Another Q – How do I change values of Y axis which has value 1-100?
This doesn’t work
The cache files are corupt. Just tried the example and changed the url
The following errors appear in the cache files
400 Bad RequestYour client has issued a malformed or illegal request.The parameter ‘chs’ must have a width of at least 1 pixel.
Check your logs, I’m actually using this plugin in several projects and never have a problem… I was actually using it before I listed it here, and just implemented it again last week on a new site with no problem
Check your logs, I’m actually using this plugin in several projects and never have a problem… I was actually using it before I listed it here, and just implemented it again last week on a new site with no problem
No errors in apache logs
This is the complete txt file from your example
s:1436:" <html><head><meta content="text/html;charset=utf-8" http-equiv="content-type" /><title>400 Bad Request</title><style><!--body {font-family: arial,sans-serif}div.nav {margin-top: 1ex}div.nav A {font-size: 10pt; font-family: arial,sans-serif}span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight: bold}div.nav A,span.big {font-size: 12pt; color: #0000cc}div.nav A {font-size: 10pt; color: black}A.l:link {color: #6f6f6f}A.u:link {color: green}//--></style><script><!--var rc=400;//--></script></head><body text="#000000" bgcolor="#ffffff"><table cellspacing="0" border="0" width="100%" cellpadding="2"><tr><td nowrap rowspan="3" width="1%"><b><font size="10" color="#0039b6" face="times">G</font><font size="10" color="#c41200" face="times">o</font><font size="10" color="#f3c518" face="times">o</font><font size="10" color="#0039b6" face="times">g</font><font size="10" color="#30a72f" face="times">l</font><font size="10" color="#c41200" face="times">e</font> </b></td><td> </td></tr><tr><td bgcolor="#3366cc"><font color="#ffffff" face="arial,sans-serif"><b>Error</b></font></td></tr><tr><td> </td></tr></table><blockquote><h1>Bad Request</h1>Your client has issued a malformed or illegal request.<ul><li>The parameter 'chs' must have a width of at least 1 pixel.</li></ul><p></p></blockquote><table cellspacing="0" cellpadding="0" width="100%"><tr><td bgcolor="#3366cc"><img height="4" alt="" width="1" /></td></tr></table></body></html>";
php 5.3.0 version
I’m using 5.3 on my sites, and not getting an error from google.
Message me from my profile page with a link to your page so I can see how you are sending it.
I see the problem now
In the class you have hardcoded the path /googlecharts/
$url = _GOOGLECHART_URL.”/cacher.php?stream=”.base64_encode($url);
Removing solves the problem
Does this plugin handle the creation of interactive charts?
It is possible for you to write the code to create the PHP array from CSV and XML?
Download PHP Scripts Google Charts Plugin CodeCanyon Free
http://www.xvcz.com/download-php-scripts-google-charts-plugin-codecanyon-free/
No comments:
Post a Comment