mansiri - Jul 7 2008 9:31pm
- mansiri101 at gmail.com |
| hello, and thanks Elliott Brueggeman
trouble about language (Thai) |
Graeme - Jul 5 2008 6:27pm
- graemek at xtra.co.nz |
| Thanks Elliot for a great package! Is there a way of having the x-axis labeling showing only every 2nd, 3rd or 4th label etc only (automatically or manually), as I can't widen the graphs anymore but want to show a period of 365 days, and the x-axis gets pretty crammed with text? It still needs to show the y-values for all entries in the 365 element array however. Thanks in advance. |
Hakan - Jul 4 2008 2:39am
|
| Any progress on the zero value issue? I am making a graph that plots distance traveled each month, and there will most likely be months when the distance is zero. |
Robert Brown - Jul 3 2008 9:49am
- Robert at wesayhowhigh.com |
| Hi
Is there any way of changing the width of a bar? When grouping and the bars are overlayed on top of each other it would be useful to change the width of the bars. Is this possible?
Many thanks
Robert Brown |
bb - Jul 1 2008 8:45am
|
| i meant the x-axis, of course. ;) |
bb - Jul 1 2008 8:11am
|
| hello, and thanks for your work. is it possible to reverse the y-axis like 1-12 where 1 is the highest and 12 is the lowest value? that would be nice for soccer charts like a season overview of a team. thanks ... |
sajan - Jun 27 2008 8:55pm
- sajan_ltp at hotmail.com |
| is it possible to create bar chart with different color eg: bar1=>red, bar2=>green, bar3=> balck and so on |
Elliott Brueggeman - Jun 16 2008 9:22am
|
| In response to anonymous's question - currently you cannot add text to the X and Y axis, but you can add a descriptive legend. See example 4 on the Examples page. |
Anonymous - Jun 14 2008 4:27am
|
| is there no possibility to add a text what the x/y-axis describes? like "time" or "hits" or so... |
Chris - Jun 8 2008 8:34pm
- cbianchi at limitedbrands.com |
| I'm encountering a problem when my data sets have a range of zero (0). The min value and the max value are the same. The phpGraphLib code attempts to divide by the range to calculate the Y-axis. But when this occurs, the processing fails. I'm trying to build a traffic graph but am unable to do so. If a person has no traffic (0 hits) for the specified date range, the graph fails. This, in my opinion, is a significant bug. |
Beast - May 15 2008 2:39am
- beast at magnalega.it |
| Ok...I solve the problem about adding more than 3 data set, I'm gonna modify the function adddata...thx anyway |
Beast - May 15 2008 2:33am
- beast at magnalega.it |
| It may be useful the possibility to order the X values in Asc or Desc way. In my case I need to create a graph where lower values are better than higher, actually it is impossibile, isn't it?
Thx |
Beast - May 14 2008 2:24pm
- beast at magnalega.it |
| Hi,
this is really a good library.
Is possible to show more than 3 data set?
Thx |
Rachel - May 13 2008 8:34am
|
| Hi Elliot,
I did the following and solve the problem.
/sbin/restorecon -v phpgraphlib.php
Thanks a lot! It is really a wonderful tool.
Rachel |
Rachel - May 13 2008 8:13am
|
| Elliot, thanks a lot for the answer. I do have httpd and mysqld install on my Fedora machine. I also installed php-gd. I tried the following code from the web, it could display a image
$graphValues=array(0,80,23,11,190,245,50,80,111,240,55);
header("Content-type: image/png");
$imgWidth=250;
$imgHeight=250;
$image=imagecreate($imgWidth, $imgHeight);
$colorWhite=imagecolorallocate($image, 255, 255, 255);
$colorGrey=imagecolorallocate($image, 192, 192, 192);
$colorBlue=imagecolorallocate($image, 0, 0, 255);
imageline($image, 0, 0, 0, 250, $colorGrey);
imageline($image, 0, 0, 250, 0, $colorGrey);
imageline($image, 249, 0, 249, 249, $colorGrey);
imageline($image, 0, 249, 249, 249, $colorGrey);
for ($i=1; $i<11; $i++){
imageline($image, $i*25, 0, $i*25, 250, $colorGrey);
imageline($image, 0, $i*25, 250, $i*25, $colorGrey);
}
for ($i=0; $i<10; $i++){
imageline($image, $i*25, (250-$graphValues[$i]), ($i+1)*25, (250-$graphValues[$i+1]), $colorBlue);
}
// Output graph and clear image from memory
imagepng($image);
imagedestroy($image);
However, I am still having problem displaying graphs using some of your sample code (Basically I got blank pages).
Thanks a lot again!
Rachel |
Elliott Brueggeman - May 13 2008 8:03am
|
| In response to Rachel's question. It sounds like you may have an issue with your approach. From your using the command line, I'm guessing you're doing this on your own computer, and not a hosted web server like GoDaddy. You need to have a webserver installed on your computer to work locally. Apache HTTP server is the most popular and easy to use. You'll also want to install PHP on your computer after you install Apache, so it can hook into the server. There are plenty of tutorials on the web to accomplish the above steps. Having done this, you will be able to open PHP scripts through your webserver using the address localhost/script_xxx.php - Do not open the file from the file->open method, as this won't go through thr web server. |
Elliott Brueggeman - May 13 2008 7:54am
|
| In response to Joseph's question - while plotting two data sets is possible, they must share the same x-axis values. So if they both had x-axis values of 1,2,3,4,5 then you would be able to plot different values for them. Unfortunately, it sounds like you want to plot different values for both axis. |
Rachel - May 13 2008 7:32am
|
| Hi Elliot,
Thanks a lot for the great tool. Very easy to use. I am quite new in PHP programming. I hope you can solve this problem for me. I was able to generate a png image on command line:
php script.php > test.png
However, I could not display the image on Firefox using
<img src="script.php">
I hope you can help me with this.
Thanks again,
Rachel |
Joseph - May 13 2008 3:41am
- jkkenzie at gmail.com |
| Hi!
I want to know if it is possible to plot values X against values Y using your library.
i.e i have 2 countries, each with X values and Y values (e.g Country 1( X=1,2,3,4,5,6 and Y=2,5,1,7,3,6 ) Country 2 ( X=(12,11,6,4,3,9) and Y=( 2,5,3,7,8,2) )
THIS IS LINE GRAPH, therefore i will have X values ranging from Zero to highest value of X values for both countries.(this is just a suggestion)
I think you are getting my point..
I had this code:
//country 1
$data=array($C[0]=>$A[0],$C[1]=>$A[1],$C[2]=>$A[2],$C[3]=>$A[3],$C[4]=>$A[4],$C[5]=>$A[5],$C[6]=>$A[6],
$C[7]=>$A[7],$C[8]=>$A[8],$C[9]=>$A[9],$C[10]=>$A[10],$C[11]=>$A[11]);
//Country 2
$data2=array($C[0]=>$A[12],$C[1]=>$A[13],$C[2]=>$A[14],$C[3]=>$A[15],$C[4]=>$A[16],$C[5]=>$A[17],
$C[6]=>$A[18],$C[7]=>$A[19],$C[8]=>$A[20],$C[9]=>$A[21],$C[10]=>$A[22],$C[11]=>$A[23]);
//Country 3
$data3=array($C[0]=>$A[24],$C[1]=>$A[25],$C[2]=>$A[26],$C[3]=>$A[27],$C[4]=>$A[28],$C[5]=>$A[29],$C[6]=>$A[30],
$C[7]=>$A[31],$C[8]=>$A[32],$C[9]=>$A[33],$C[10]=>$A[34],$C[11]=>$A[35]);
//country 4
$data4=array($C[0]=>$A[36],$C[1]=>$A[37],$C[2]=>$A[38],$C[3]=>$A[39],$C[4]=>$A[40],$C[5]=>$A[41],$C[6]=>$A[42],
$C[7]=>$A[43],$C[8]=>$A[44],$C[9]=>$A[45],$C[10]=>$A[46],$C[11]=>$A[47]);
I thought i was plotting the X axis values against the Y axis values for each country BUT........
The Y values were OK but the X Values took ONLY the values (KEYS) for the first country ($data) .
Your assistance would highly be appreciated.
Yours Faithfully,
Joseph |
SoftX - Apr 10 2008 9:18am
- secko99 at gmail.com |
| Thanx for great graph tool.
I use with mysql for graphing signal on cable modems.
There is 3 parameters on same graph UP,DOWN,SNR
but colours on all 3 lines are same.
Anyway it's great soft.. |
Elliott Brueggeman - Apr 7 2008 9:16pm
|
| In response to spx, anti-aliasing is a good feature, but there are some issues with it in PHP as it applies to lines. PHP's Image functions allow anti-aliasing, but only when using true color images. PHPGraphLib does not create true color images for backwards compatibility. I will attempt to handle this problem gracefully in a future release. |
spx - Apr 7 2008 8:18pm
|
| Great script, but I'd love to see an anti-aliasing option. |
Elliott Brueggeman - Apr 6 2008 9:44am
|
| In response to gkg_, the x-axis is specified as the array keys of the data array. See the examples page. |
gkg_ - Apr 6 2008 9:27am
- gegounaris at gmail.com |
| How can I set specific data in the X axes? |
Brent - Apr 3 2008 7:52am
|
| Nevermind, I figured it out. |
Brent - Apr 2 2008 9:27am
|
| This library is awesome. Much better than some of the others I've played with. I'm having a problem with a query that has a dynamic where clause. It won't generate a graph because it thinks there are too many variables.
Thanks for the help. |
Chris - Mar 29 2008 10:20pm
- chrisjohnson00 at hotmail.com |
| Hi Elliott,
First let me start off by saying this is a great library. I'm using your library to graph disk usage on my file server over time. I use the data to determine the rate at which the disks are being filled up and now much time I have until the disks are full. There are a couple of features that I think would be useful add. 1) Moving averages (like what is used in stocks). 2) A projection line, which would show estimated future data based on current trends. |
Anoop - Mar 25 2008 11:59pm
- anoop at nxtcty.com |
| Finally my search ended here...
Really great job dear.
Thanks a lot. |
Sparky - Mar 24 2008 6:31pm
|
| Your library is amazing! I just downloaded and tested out some graphs, and I love it. Your code is very easy to use and the documentation for using the library is excellently done.
You said that we can make adjustments to the library, correct? I added one parameter to a function. Let me know if this is ok.
One question, I could not find the function to label the x and y axis for a linear graph. Is there a function to add labels to the x and y axis?
Thank you so much for this library. |
Simone - Mar 12 2008 6:26am
- simone_lillini at hotmail.com |
| Hi Elliott,
I try to use phpgraphlib. It's ok, but it'work only on internet explorer and not with mozilla firefox. Where I make a mistake? |
Elliott Brueggeman - Mar 8 2008 9:33am
|
| Interesting find, fin, I may inlcude that in the next release of PHPGraphLib for people who will end up printing their graphs. |
fin - Mar 6 2008 6:53am
|
| Hi Elliott. I discovered the problem. I added this line to the graph.php file... session_cache_limiter('public'); Which seems to have done the trick. The problem was also only allowing me to save the graph as a untitled.bmp file. Thanks again for this great script. |
vedranp - Mar 3 2008 4:22am
|
| Another hint: the chart width could be adjustable according tho the number of records that have to be displayed. In this way also large number of points could be placed on thechart which would be in this case larger or at least customizable by the user. |
fin - Feb 29 2008 4:29am
|
| Is it possible to print the graph from the webpage? When I try to print it it wont print but other images on the page print fine. |
fin - Feb 29 2008 4:11am
|
| Thanks Elliott, my problem was that it I wasn't using session variables. My PHP skills aren't the best so I wasnt sure if I was doing something wrong or if it may not have been possible at all. Thanks for your help. |
vedranp - Feb 28 2008 7:28am
|
| Is it possible to adjust (manually or automatically) the number of displayed labels on X or Y axis? Example: if displaying some values for each hour of a day, it soon becomes unreadable, if number of days increases. If there would be a possibility to adjust the interval of hours displayed (every fourth or eight hour - or auto mode), without leaving out the Y values, than the use of this library would be even better. |
Elliott Brueggeman - Feb 27 2008 6:23pm
|
| In response to "fin"- that way should work just fine. If you are still having problems, you can email me at the email address on the PHPGraphLib home page. |
Elliott Brueggeman - Feb 27 2008 6:22pm
|
| In response to "Anonymous" on February 26th, the easiest way to pass the graph values is by setting and then retrieving session variables. You can also pass arguments to the url of the graph when including it on the page. AKA: <img src="myimage.php?total=10&users=5">. |
fin - Feb 27 2008 8:10am
|
| Hi, Great Code. I have tried to use variables in the $data array but cant get it to work. The code I am using is $data=array($var1,$var2,$var3,$var4); Is there any reason why this wont work or is it purely my syntax. The code obviously works perfect with numbers instead of variables. Thanks. |
Anonymous - Feb 26 2008 2:31pm
|
| Is it possible to use php variables taken from a form instead of a list of predetermined values? |
Anonymous - Feb 19 2008 7:18pm
|
| Answered my own question below.. add a random number(or even better time) to the file. Will force a browser refresh of that image. |
Anonymous - Feb 19 2008 6:54pm
|
| It seems you actually have to refresh the page to get a new chart to load.. Is it possible to delete the current chart should a user press back and then the data set is changed? |
Javier - Feb 7 2008 10:47am
- baldanj at hotmail.com |
| I want to display both the day and the time across the x axis for one set of data. |
Elliott Brueggeman - Feb 7 2008 9:28am
|
| In response to Javier's question - Do you want to display two distinct sets of data, or do you want to display both the day and the time across the x axis for one set of data? |
Javier - Feb 7 2008 7:45am
- baldanj at hotmail.com |
| Hi Elliot, I want to show 2 fields in x values (date & <br>time). How can I make that? Thanks! |
Anonymous - Feb 5 2008 9:19pm
|
| Hi there...
is there a way to make this chart realtime, refreshing it self every 1 seconds to show the changes of data provided.? |
james - Jan 24 2008 11:25am
|
| Awesome tool! Is there a way to add transparency to a bar chart? Thanks! |
Elliott Brueggeman - Jan 13 2008 5:48pm
|
| In response to Pete's comment - you have an error in the way that you specify the array of values. Try specifying them like this: $data=array( "a"=>1000, "b"=>500, "c"=>5);
With such a small third value, you may notice that it is displayed as just a single 1 pixel line, or even no line at all if the graph is small enough. Try enlarging the size of the graph is this is a problem. |
Pete - Jan 13 2008 4:46am
|
| Hi, I've some problem with the pie graph. If some data has the value that is zero percentage in the graph. Like, "a->1000, b->500, c->5", The graph will draw only the color representing the data c for the whole pie. Well, I end up get one big orange pie and many chocolate pie.
Are there any way around?
Thanks in advance. |
Elliott Brueggeman - Jan 11 2008 3:02pm
|
| Horizontal bars charts are not available in PHPGraphLib. |
Anonymous - Jan 9 2008 4:01pm
|
| Hi, is there a way to display horizontal bar instead of vertical bar? |
Elliott Brueggeman - Jan 9 2008 7:56am
|
| In response to jun, you cannot directly change the intervals as this is calculated by an algorithm. However, you can change the range of the y-axis with the setRange() function. This will affect the intervals on the y-axis. Experiment and you may be able to find the scale you want. |
jun - Jan 9 2008 7:20am
- layjun at gmail.com |
| Sorry this may sound like a stupid question, how do I change the increasing value of the Y axis? Now that it changes by itself through the setting of the constructor. how do I make it increase by 5 like 0, 5, 10, 15... Help appreciated much! |
Anonymous - Jan 8 2008 12:54am
|
| (How?)Is it possible to add more then three data arrays in a chart? |
Bill - Dec 22 2007 2:21pm
|
| Anyone interested in my revised “$graph->createGraph()” function that will allow you to save a graph to a file can contact me at this address “bill at onepost dot net” . If I don’t get spammed, I will keep this address active until mid January 2008. |
Anonymous - Dec 22 2007 6:52am
|
| Elliott: Would you consider releasing the source code for the updated captcha that you are using on the discussion page? |
Bill - Dec 21 2007 6:40pm
|
| Pedro, if you view the source (View Source) for this discussion page you will see how the PHP code in my last post should be formatted. |
Bill - Dec 21 2007 5:07pm
|
| Pedro this may be of some help to you. I don't use AJAX but I have some <div's> in web pages that I update dynamically via a javascript. I had problems with graphics not updating when the <div> was rewritten. By adding this PHP code at the TOP of BOTH the main webpage and the PHP script that updates the <div> the problem was solved.
<?php
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
?> |
bruce - Dec 21 2007 4:09pm
- bruceatsharedotnetdotenzed |
| that code snippet of Bills (file output) would be very useful if added to documentation downloads |
Elliott Brueggeman - Dec 20 2007 9:17am
|
| In response to SIjo's question - the length of the x-axis values (12/14/2007) are too long. You can either allocate more space for them with the $graph->setupXAxis(xx) function where xx is the % of total graph height allocated for x-axis value display. Or, you can switch the orientation of the values to horizontal by adding the following function: $graph->setXValuesVertical(false); |
SIjo - Dec 20 2007 4:45am
- sijomon3 at gmail.com |
| I put the values like that
$data=array("12/12/2007"=>5,"12/13/2007"=>10,"12/14/2007"=>15,"12/15/2007"=>10,"12/16/2007"=>11);
$graph->addData($data);
but it printed last four character in x-axiz like :2007
how i can print full date like 12/12/2007 in x-axis |
Elliott Brueggeman - Dec 19 2007 8:51am
|
| Interesting question - AJAX is not my area of expertise, so I cannot immediately think of a solution to this problem. Perhaps someone else who monitors this forum would have a better idea of how to accomplish this?... |
Pedro, from spain. - Dec 19 2007 2:42am
|
| Hi,excellent job!I have a form where choose two dates and show the graph first time in a <div> but I use Ajax to process the form, the problem is that the graph no change when send the form the second time.How destroy the graph? |
Elliott Brueggeman - Dec 18 2007 7:36am
|
| In response to Jay's question - I have not implemented axis titles because of the desire to keep the source code lite and the lack of demand for the feature. I encourage you to research PHP's imagestring() module to accomplish this task. |
jay - Dec 18 2007 2:12am
|
| Hi.. can somebody tell me how tu put a title for axis x & y
Thanks in advance. |
Bill - Dec 5 2007 12:17pm
|
| Leo.C and Robbert S: If you provide me with your email address I will send you my revised “$graph->createGraph()” function that will allow you to save a graph to a file. NOTE Elliott’s statement below; “be aware that code is not covered by the PHPGraphLib commercial license or the for personal use Creative Commons license”. |
Elliott Brueggeman - Dec 5 2007 8:29am
|
| Modifying the createGraph() function with a possible extra value to accommodate saving the graph to a file is a good solution - I'll put this on the list of items for the next release. You may give out the code for the extra feature directly to the person who requested it, but be aware that code is not covered by the PHPGraphLib commercial license or the for personal use Creative Commons license. |
Bill - Dec 4 2007 4:14pm
|
| Regarding the all zero datapoint values. I am using PHPGraphLib to graph the past 24 hour temperatures in degrees Celsius. If the temperature for each of the past 24 hours was zero degrees Celsius the data would be valid but PHPGraphLib would reject it as invalid. This is very unlikely to ever occur but if it can happen it will happen, just don’t know when. |
Bill - Dec 4 2007 3:38pm
|
| Looks like the discussion forum doesn’t honor CR’s and this will make a code snippet difficult to read. I can put the snippet file on my download server and give them the URL if that’s ok with you.
Bill. |
Bill - Dec 4 2007 3:25pm
|
| Elliott: I noticed a couple of people are interested in writing the graph to a file and I had the save requirement. I modified the phpgraphlib.php createGraph() function to accommodate file writes.
Modified Syntax = createGraph('OutputLocation','FileName');
$graph->createGraph(); No change. Just outputs to the browser.
$graph->createGraph('both','C:/MyFile.png'); Outputs to both the browser and file.
$graph->createGraph('file','C:/MyFile.jpg'); Outputs only to file.
$graph->createGraph('browser','C:/MyFile.gif'); Outputs only to browser (ignores the file name).
Supports png, jpg & gif file extensions using imagepng(), imagejpeg() & imagegif()
If ok with you I will drop the modified code snippet in the discussion forum.
Bill. |
Elliott Brueggeman - Dec 4 2007 2:44pm
|
| Thirty zero datapoints is not valid data - PHPGraphLib is supposed to display a warning if all your data is zero - I'll check why this warning message is not being displayed.
In the meantime, try validating your data first before creating a graph - I can't imagine you want to have a graph with nothing on it. Use an if clause and only creating a graph is there is at least one non zero value. If there is not, just display an error message. |
Anonymous - Dec 4 2007 2:07pm
- adenwala at gmail.com |
| i downloaded the version 2.0, and still having the zero-values problem described earlier.
I have 30 datapoints, and all are zero. In that case the script still runs in an infinite loop.
Can you tell me a workaround? Thanks |
Robbert S - Dec 3 2007 2:58am
|
| I have the same problem as Leon. I also don't know how to save the created dynamic image to an static (for use in an pdf) |
Leo.C - Nov 28 2007 7:06am
|
| Is it possible to save the graph image? I tried with the function imagepng($file, $path) but what i have to put into $file? With $graph it doesn't work and doesm't save the image. Please excuse me if i put a stupid question but I'm a dummie!
Thank'you |
Elliott Brueggeman - Nov 27 2007 8:05am
|
| In response to Bill's question - negative ranges in the setRange() function are on the to-do list for the next major release. |
Elliott Brueggeman - Nov 27 2007 8:03am
|
| Sorry Dwer, that is not currently available, and I don't see adding the additional code for it in the near future. It would be useful, but I'm trying to keep PHPGraphLib as light as possible. |
Dwer - Nov 27 2007 6:01am
- dwerdota at yahoo.com |
| Any luck with my question, Elliot? :) |
Bill - Nov 27 2007 6:00am
|
| Do you have any plans to incorporate negative ranges into the y-axis setRange() function? |
Bill - Nov 26 2007 1:40pm
|
| Your graphing library is outstanding and with very little processor overhead, it’s fast and runs without problems. I am a retired programmer/network-administrator and know the hours that you must have spent putting the library together.
Keep up the great work |
Elliott Brueggeman - Nov 26 2007 10:18am
- ebrueggeman at gmail.com |
| In response to Rob's question - You cannot include a PHPGraphLib script inside a page that has already sent its headers. The recommended way is to include the my_script.php as an image, and then the page that has the image can send its own headers in addition to PHPGraphLib sending its headers. |
Rob - Nov 25 2007 6:53pm
- robretz at theretzy.com |
| Trying to get this to work with a Javascript or HTTP Meta-refresh. Anytime I try to echo one through PHP or use it in a <head> tag it wipes out the graph. Any ideas? |
MTL - Nov 24 2007 2:36pm
- ptwob_104 at yahoo.com |
| Never mind... I realized I needed to use a session variable, and that made everything work just fine! Great tool.. |
MTL - Nov 24 2007 1:30pm
- ptwob_104 at yahoo.com |
| Thanks Elliot for pulling together a great script! I have a quick mysql integration question. I am dynamically generating a page from the database, on which I would like to embed a graph generated by PHPGraphLib. I need to use a dyanamic query string for both the graph data and the detail page where the graph will reside. Can I pass a variable to the graphing script and the redirect to the detail page. It seems like I can't use the php header() function after createGraph(). I can get all the mysql to work so that isn't an issue. It's really just a flow issue. Any general recommendations on how to go from a master page to a detail page with a chart built in?...
Sorry in advance for the confusing description, I'm still a bit of a php nube... MTL |
Anonymous - Nov 22 2007 7:45pm
|
| Amazing! And thanks for adding the horizontal text functionality. |
Dwer - Nov 16 2007 1:04pm
- dwerdota at yahoo.com |
| This is a follow up question.. Is it possible to insert a logo on top of the graph? |
Dwer - Nov 16 2007 10:35am
- dwerdota at yahoo.com |
| I wonder if it's possible to reverse the orientation of a line graph? Like say if I were to graph the clock time of a swimmer, the lower the time is, the higher it would be in the graph? |
Elliott Brueggeman - Nov 12 2007 10:20am
|
| In response to the previous question, you can modify the PHPGraphLib source code to accomplish this task. PHP supplies the functions imagestring() and imagestringup(). To have text inserted in an up/down direction use imagestringup(), and for normal text use imagestring(). You can swap these functions out throughout the PHPGraphLib source text to accomplish this task.
Also, the next release of PHPGraphLib, to be released within the next few days, will include this functionality natively. |
Anonymous - Nov 12 2007 9:37am
|
| Could someone tell me how to rotate the horizontal text on the graph. Thanks... |
mik - Nov 2 2007 4:19pm
- kty at hotmail.com |
| This site truly amazing!!! |
ttre - Nov 2 2007 1:48pm
- jgh at mbn.cv |
| Excellent resource you've got here!!! Will definately be back!!! |
sink - Oct 31 2007 4:33am
- mnj at ik.com |
| that's neat! |
Elliott Brueggeman - Oct 30 2007 8:38pm
|
| In response to the previous question, you can certainly increase the size of the title text by modifying the generateTitle() function. The "2" in the "imagestring($this->image, 2, ..." call is the size of the text. You can change this to 3 or 4 to make it bigger. In future versions, I'll separate all font sizes into variables for easier tuning. |
Anonymous - Oct 30 2007 4:26pm
|
| Great tool! Is there any way to enlarge the graph title? |
mgj - Oct 24 2007 2:18am
- qwss at iy.com |
| Great site! |
Anonymous - Oct 17 2007 2:32am
- hlwcx at zyctcop.com |
| Hello! Good Site! Thanks you! hobtxdsldajjz |
vizzy - Oct 12 2007 11:16am
- info at tellmatic.org |
| hi, nice lib, but im sorry to see that i can't use it with my gpl project because of license incompatibility :( |
Elliott Brueggeman - Oct 7 2007 1:43pm
|
| In response to the previous question, you want to manipulate the X-Axis spacing to fit to the data labels of your data. Try using the setupXAxis() function. Example: $graph->setupXAxis(20, "yellow"); The 20 there refers to the % of available graph height allocated to data labels. The larger the value, the more space for data labels along the x-axis. |
jon - Oct 7 2007 1:28pm
- jonathan at jgrantdesign.com |
| Im wondering how to ensure that my labels show up correctly on the bottom of a bar chart -- they cut off if they are longer than a few characters. Any thoughts before I go jumping into the PHP file? |
Anonymous - Sep 12 2007 3:56pm
|
| Could someone tell me how to orient the text on the graph. I have M,T,W,T,F,S,Su but it's lying down instead of stand up :( |
Fabio - Sep 10 2007 5:01am
- fabio at itatpinnacle.com |
| Hi
Im pretty new to php and would really appreciate some assistance.
I am having difficulty trying to get the array passed to the addData function I keep getting:
Fatal error: Call to a member function addData() on a non-object in C:webhr est2.php on line 32 to
and when i print_r($data) there is an associative array within.... |
Elliott Brueggeman - Aug 31 2007 9:50am
|
| Yes, that is that GD2 Library - seeing that uncommented in your php.ini file means that it is enabled. This also means that you are likely using a newer version of PHP that is bundled with the original GD library. You should be good to go. |
Anonymous - Aug 31 2007 9:45am
|
| Could someone tells me if the GD library is the line below?
It showed as gd2.
;extension=php_gd2.dll |
Anonymous - Aug 30 2007 8:43am
|
| I got it to work. I'm so happy that I wanted to cry. :) |
Elliott Brueggeman - Aug 28 2007 6:13am
|
| In response to Nagyl, drawing vertical lines that are separate from the graph requires that you add in some of your own php programming. Investigate the imageline() function for more information. Only the most commonly used and requested graph features have been inlcuded in PHPGraphLib to keep the footprint as small as possible. Also, the x-axis percent must be above 0 to be considered a legal value, or else a default percentage is used. |
NagyI - Aug 28 2007 5:57am
- nagyi at geotop.ro |
| HY
With PHPGraphLib can I:
- draw some vertical lines like the setGoalLine?
- set the right margin to be 0px? (if setupYAxis is set to 0% appears as more than 0px, and if set to 0.1 appers as 0px)
Why need this?
I want to make a graph with diferent values set to days of a month, and I want to separete the weeks. |
Anonymous - Aug 22 2007 9:33am
- I Still Can't Get It To Work :( |
| I turned on the GD extension. Does anyone have any good examples you can show me?
Thanks, |
Anonymous - Aug 22 2007 8:42am
- Thank You Elliott!!! |
| It would be very helpful to mention "GD extension" somewhere in the Documentation. |
Elliott Brueggeman - Aug 22 2007 7:30am
|
| In response to the previous post - the width and height on lines 11 and 12 are the default height if you do not specify dimensions in the PHPGraphLib constructor. If you call the constructor like this: $graph=new PHPGraphLib(500,350); then 500 and 350 will be your dimensions regardless of the values on lines 11 and 12. Alternately, you could call the constructor like this: $graph=new PHPGraphLib(); and then the dimensions you specified for default would be used. |
Anonymous - Aug 22 2007 7:24am
|
| I change the height and width in the phpgraphlib.php lines 11-12, but I still get the same dimensions. What am I missing? |
Elliott Brueggeman - Aug 21 2007 4:24pm
|
| In response to the last 2 posts, make sure the GD extension is enabled in your php.ini file. To check, look for the GD extension in the output of the phpinfo() function. If GD is enabled, but you still have problems, make sure no output (html, echo, blank space) is in your script before the graph is generated. I will add this to the documentation as well. |
Anonymous - Aug 21 2007 4:13pm
- Would Someone Tell Me? |
| I used the example code but I couldn't get to show the graph. Am I doing something wrong? |
Anonymous - Aug 21 2007 3:46pm
- How Come I Can't Get This To Work? |
| I used the sample code #1, nothing is on my screen? :( |
helmut - Aug 21 2007 11:49am
|
| Could you add a function that allows bar graphs to be oriented horizontally? Thanks. |
clemnet - Aug 17 2007 3:42am
|
| Hi,
Great tool. Wondering is it possible to have the colours change to reflect the values? I.e for a temperature graph, colour gets a brighter red as it increases? |
helmut - Aug 16 2007 3:16pm
|
| Never mind. It turns out that the php-gd package was not installed... I'd recommend putting that in the system requirements for this product. |
helmut - Aug 16 2007 3:00pm
|
| I've been fiddling with this for a couple hours now and I have yet to see it work. I've been placing the phpgraphlib.php file in the same html dir as the graph's file and all I get is a blank screen. To make things easier, I tried this only with your examples... I'm using PHP 4.3.9 and Apache 2 on a RHEL 4 box, any insights? |
John - Aug 14 2007 1:23pm
|
| This is a great graph lib :), thanks. |
Elliott Brueggeman - Aug 11 2007 11:49am
|
| I have uploaded a bugfix release addressing the issue found earlier when the addData() function is not called. |
Elliott Brueggeman - Aug 10 2007 2:42pm
|
| In response to "Anonymous" - thanks for your discovery. I will look into this when I get a spare moment, and hopefully I will be able to issue a bugfix release later this weekend. |
Anonymous - Aug 10 2007 1:24pm
|
| Hmm - I found a very subtle bug - if all the data points are 0, then it runs into an infinite loop. This case doesn't come up often, but handling this case would be nice. I also expect this to be a problem if all the data points are the same value, regardless of whether that value is 0 or not. |
Vincent Guissard - Jul 30 2007 1:33am
|
| I it possible to customise the Y value position of the Absys (usefull for large value positive or negative datasets with small variations) ? |
Bo Henriksen - Jul 29 2007 1:14pm
- stumpdenmark at hotmail.com |
| Thanks a lot! I am looking forward to a new release then... :) |
Elliott Brueggeman - Jul 29 2007 11:02am
|
| In response to the previous two posts - I will definitely add the ability to have multiple data sets to the next version of PHPGraphLib. |
Bo Henriksen - Jul 29 2007 9:19am
- stumpdenmark at hotmail.com |
| Very nice script! It would be nice if it was possible to display more than one data set, that is, multiple lines as Simon Huntley already has pointed out. |
Simon Huntley - Jul 27 2007 8:36am
- info at smallfarmcentral.com |
| This is a nice script -- thanks.
Is it it possible to output a graph with multiple lines drawn on the same graph? Maybe using 3-d arrays or something? I can't see any examples like this or infer it from the documentation.
Thanks so much. Could you send me an email if you get time to answer this question? |
Elliott Brueggeman - Jul 23 2007 7:36am
|
| In response to "Anonymous" - I have added a PHPGraphLib and MYSQL example to the documentation page. |
Anonymous - Jul 20 2007 6:49pm
|
| Ok, I have created a updating graph by using the following code (after connecting to the db) but i cant seem to select from more than 1 column, any help?
$sql = "SELECT def, count(*) AS def1
FROM answer
GROUP BY def";
$result = mysql_query($sql);
$data = array();
while (list($def, $def1) = mysql_fetch_row($result))
{
$data[$def] = $def1;
}
include("phpgraphlib.php");
$graph=new PHPGraphLib(400,300);
//$data=array("1"=>$def1, "2"=>198, "3"=>70, "4"=>90);
$graph->addData($data);
$graph->setTitle("Definitions");
$graph->setGridColor("153,204,255");
$graph->setGradient("red", "maroon");
$graph->setBarOutlineColor("black");
$graph->setTextColor("blue");
$graph->createGraph();
// Closing connection
mysql_close($link);
?> |
Elliott Brueggeman - Jul 20 2007 11:33am
|
| In response to Gary's question: you need to familiarize yourself with how PHP and MYSQL are used together. One of the best ways of doing this is to view the official PHP documentation on the MYSQL extension. You can view this here: http://www.php.net/mysql - look at the first example on the page for executing a MYSQL query and returning the results. After you've figured this out, turning the result into an array in PHP is rather trivial. |
Gary - Jul 20 2007 11:14am
|
| How would you use data from a mysql data base with a graph? how would you put the result of a query into the array? |
Teeja - Jul 17 2007 7:48am
|
| Thanks for this class. |
|
|