 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
|
 |
|
 |
02-22-2008, 07:03 PM
|
#21 (permalink)
|
|
The Visitor
Join Date: Feb 2008
Posts: 3
Thanks: 1
|
Thanks for posting this, Good Stuff!
It looks like there is only support for axis labels for pie charts (i.e. no 'chxl'). Is that correct or am I missing something, before I go off and add it?
Witt
|
|
|
|
02-24-2008, 02:39 PM
|
#22 (permalink)
|
|
The Reckoner
Join Date: Sep 2007
Posts: 437
Thanks: 22
|
No I don't think I added support for that. So yeh, unfortunately you may have to add it yourself :(
__________________
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
|
|
|
|
The Following User Says Thank You to Karl For This Useful Post:
|
|
03-28-2008, 10:49 AM
|
#23 (permalink)
|
|
The Visitor
Join Date: Mar 2008
Posts: 4
Thanks: 1
|
Hey All,
I have been hunting around for a PHP wrapper for the Google Chart API and from what I have seen this is definitely the best out there at the moment.
I was wondering if there is any site for this project, or if it is just on this thread at the moment? I would like to contribute to it in order to get the axis labels working (if this has not yet been done by someone else).
I think that this could end up being the way for PHP devs to work with the chart API, but it could really do with some sort of project page, svn repo, wiki etc.
Anyway, I guess my questions are:
1) Does such a project area exist?
2) Does the axis-label code already exist?
Thanks,
Adam
PS. Just FYI: Uploading an Avatar from a URL (rather than a local file) seems to be broken on the forum's 'Edit Avatar' page (cannot the write temp file).
Last edited by adamcharnock : 03-28-2008 at 11:12 AM.
|
|
|
|
03-28-2008, 02:04 PM
|
#24 (permalink)
|
|
The Visitor
Join Date: Feb 2008
Posts: 3
Thanks: 1
|
Adam,
I can't answer question 1, but I did add some code that creates y axis labels for bar charts (should work with line charts too.) I also added the ability to automatically generate the axis labels based on the data.
I put in just what I needed to accomplish my goals, but I'd be happy to share if you're interested.
Witt
|
|
|
|
03-28-2008, 02:25 PM
|
#25 (permalink)
|
|
The Visitor
Join Date: Mar 2008
Posts: 4
Thanks: 1
|
Hi Witt,
If you don't mind sharing what you have done that would be great! Do you mind posting it on the form?
Thank you!
Adam
|
|
|
|
03-28-2008, 04:17 PM
|
#26 (permalink)
|
|
The Reckoner
Join Date: Sep 2007
Posts: 437
Thanks: 22
|
Hi Adam,
Thanks for the post, it's always nice to see some positive comments. I havn't really done much with the project, so, to answer your questions:
1) Nope
2) Nope (Edit: I see Witt has though. Thanks Witt)
As for a project page, that would be great, but it's something I've never actually done myself, maybe you can steer me in the right direction or set it up yourself? With other people contributing, I'd probably contribute more myself too.
Looking forward to your reply :)
__________________
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
|
|
|
03-30-2008, 01:22 PM
|
#27 (permalink)
|
|
The Visitor
Join Date: Mar 2008
Posts: 4
Thanks: 1
|
Hi Karl,
Sorry for taking a while to get back. I have been working on seting up a project site for this, but have have been a little busy over the past couple of days, and I need to go and see a client on Monday/Tuesday, so you can probably expect some progress on this later in the week.
One thing though - do you have any project name in mind? I came up with gPhart, for Google PHP Chart :p
I'll be in touch again soon!
Adam
|
|
|
|
04-02-2008, 11:36 AM
|
#28 (permalink)
|
|
The Reckoner
Join Date: Sep 2007
Posts: 437
Thanks: 22
|
Hi Adam,
No I currently don't have any product name in mind, I was gunna keep it simple with something like GPChart, but I guess we could have the cheekier variant, GPhart :)
Karl
__________________
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
|
|
|
04-22-2008, 07:18 PM
|
#29 (permalink)
|
|
The Visitor
Join Date: Feb 2008
Posts: 3
Thanks: 1
|
Y-Axis labels for bar graph
Sorry it's taken me so long to get back to you on this. The attached code adds the ability to automatically generate y-axis labels for bar charts based on the data (it may work for line charts too.)
Here's an example of how the new code is used:
PHP Code:
$chartData = new GChart_Data_Generic($data, '', $layer->getFieldPresNames($fields), array(),
'336699', $layerData[$layerAppName]->numYAxisDigits);
$chart = new GChart();
$chart->setSize('auto',200)
->setType(GChart::TYPE_BAR_VGROUPED)
->setTitle($layerData[$layerAppName]->title, '336699', 14)
->setDataEncoding(GChart_Data_Encoder_Factory::TEXT_W_SCALING_ENCODING)
->setBackgroundFill(new GChart_Fill_Solid('B1BBC5'))
->setMaxValue($chartData->getMaxValue())
->addAxis(new GChart_Axis('x,y'))
->setAutoBarWidth(true)
->addData($chartData);
//error_log($chart->render());
echo '<img onload="graphImageLoaded();" src="' .
$chart->render() . '" alt="'.$layerData[$layer]->title.'"/>';
I couldn't figure how how to make the y-axis labels be consistent with how google scales the data using simple encoding, so I switched to Text encoding with scaling and added a new class to GChart/Data/Encoder to support that (the existing Text class didn't support scaling).
Please be aware that I only added what I needed to get my project done.
On another note, I think I found a bug in GChart.php on line 148. It's setting $this->m_szDataEncoding; I think it should be $this->m_szEncoding.
Let me know if you have any questions.
Witt
|
|
|
|
06-24-2008, 07:35 PM
|
#30 (permalink)
|
|
The Visitor
Join Date: Jun 2008
Posts: 1
Thanks: 0
|
Problem extracting ZIP file
I got an error while trying to unzip gchart-witt.tar.zip from Witt's post on 4-22, did it work for anyone else?
Here is the error msg:
End-of-central-directory signature not found. Either this file is not a Zip file, or it constitutes one disk of a multi-part Zip file.
Thanks!
|
|
|
|
10-06-2008, 08:35 PM
|
#31 (permalink)
|
|
The Visitor
Join Date: Oct 2008
Posts: 1
Thanks: 0
|
Out of interest, does the wrapper do data scaling?
So for instance if the dataset for a pie chart has values exceeding 4096, will the wrapper scale the whole dataset to bring all values below 4096?
OBTW, I get the same problem with Witt's ZIP.
-- hugh
|
|
|
|
02-06-2011, 02:13 PM
|
#32 (permalink)
|
|
The Visitor
Join Date: Feb 2011
Posts: 2
Thanks: 0
|
Just wondering if someone could post an sample for using witt's version of the class? I'm getting a bit stuck getting past the sample he posted - which seems to refer to a bunch of stuff not in the sample :(..
Thanks :)
|
|
|
|
02-07-2011, 07:10 AM
|
#33 (permalink)
|
|
The Acquainted
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
|
it is over 2 years old...
__________________
Thanks... Simon
Sex, Drugs & Linux Rules
|
|
|
02-07-2011, 08:04 AM
|
#34 (permalink)
|
|
The Visitor
Join Date: Feb 2011
Posts: 2
Thanks: 0
|
Hi Simon,
yes I saw that... never the less people read these forums right :)
|
|
|
|
02-08-2011, 07:13 AM
|
#35 (permalink)
|
|
The Acquainted
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
|
I guess they must, to be honest I do go through some of the older posts as there is some good hints, tips and snippets here.
__________________
Thanks... Simon
Sex, Drugs & Linux Rules
|
|
|
11-30-2011, 08:42 AM
|
#36 (permalink)
|
|
The Visitor
Join Date: Nov 2011
Posts: 3
Thanks: 0
|
I have been experimenting with Google charts. Are there any alternatives that are reasonably as expressive but can be installed locally on your own web server? I don't like the idea of relying on an outside entity for a feature to work. Even if it is for cost, it would be preferable. Any suggestions?
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|