[PHP] PHP Graphing Libraries...?

2009-06-04 Thread li...@mgreg.com

Hi All,

I'm currently looking for a quality (preferably open source) PHP  
graphing library that will allow me to create various graphs and plot  
points.  I've seen several that do some amazing things, but cost a  
fortune -- others are either limited, lack documentation, or don't  
allow plotting of points for multiple entities within the same graph.


Can anyone make any quality suggestions?

Best,
Michael

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Graphing Libraries...?

2009-06-04 Thread li...@mgreg.com


On Jun 4, 2009, at 4:35 PM, Gary Smith wrote:

JpGraph?

Gary



Thanks Gary.  I've actually been looking at both "JpGraph" (http://www.aditus.nu/jpgraph/ 
)  and "XML/SWF Charts" (http://www.maani.us/xml_charts/index.php).   
However, JpGraphs is one of those that suffers from horrendous  
documentation, and neither seems to allow X-independent graphing for  
multiple entities on the same graph.  For instance, I can't give one  
entity its own array of  "x,y" coordinates and provide another entity  
with an entirely different set of "x,y" coordinates.  I must create a  
new graph for each and every entity.


My current task is an electrical one.  I'm writing an app to plot KWH  
values at specific increments.  However, the increments are unique to  
each particular event.  I can't make my X-axis uniform because not  
every event records data at every second.  And I, of course, can't  
haphazardly insert 0 values to accommodate spacing as that falsifies  
the data.  So I need to be able to plot (KWH, TIME) for multiple  
entities on the same graph.   However, as I said, neither of those  
packages seem to accommodate this in a straightforward manner.


Thoughts?


Thanks,
Michael

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Graphing Libraries...?

2009-06-05 Thread li...@mgreg.com


On Jun 5, 2009, at 5:26 AM, Richard Heyes wrote:


...


I would have to suggest RGraph... ( http://www.rgraph.net ) :-) It's
uses canvas though, so browser support is limited at the moment though
to Firefox 3.5, Safari 4 and Chrome  2.



I've looked at the docs and I don't see how exactly it handles "x,y"  
plotting.  I need the ability to plot multiple lines (which it  
obviously does) with wildly varying "x,y" values.   It seems that all  
of these libraries "cheat" and force common "x" values via the  
labels.  I need something like the following (all in the same chart):


$line_one_data = [x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y]
$line_two_data = [x,y,x,y,x,y,x,y]
$line_three_data = [x,y,x,y,x,y,x,y,x,y,x,y,x,y]

$graph->plot($line_one_data,$line_two_data,$line_three_data)

As I said, each "line" has its own set of "x,y", and although they're  
all obviously numbers, they don't all have "y" results at the same "x  
intervals" so I need to be able to control them independently.  Surely  
there's something that can accommodate this...?



Best,
Michael

Re: [PHP] PHP Graphing Libraries...?

2009-06-05 Thread li...@mgreg.com


On Jun 5, 2009, at 9:41 AM, Michael A. Peters wrote:


Sure - the gd library.
Scale the x/y position according to your needs.



Well, I was trying to avoid building from scratch, but you may be  
right.  I'm surprised no one else has need for an intuitive setup of  
this nature.



Thanks,
Michael

Re: [PHP] PHP Graphing Libraries...?

2009-06-07 Thread li...@mgreg.com


On Jun 7, 2009, at 5:37 AM, Richard Heyes wrote:


Hi,

Can I still link the scatter points with lines for readability?   
I'm not
sure why an API would require a "y" for every "x".  I've rarely  
worked with

data sets that follow an exact set of X coords.


Then where would the point go if you had no y value?

--
Richard Heyes



It should simply plot the points (and connecting lines)  
independently.  It should also consider the min/max values of all data  
sets and create those automatically if you don't set the min/max  
manually.


I wasn't saying that I lacked X values -- rather, I don't have a Y for  
every X of every other item.  For instance, say I logged information  
at 10 o'clock AM for some events, while I didn't log until 10:30 for  
other events.  I don't want to be forced to place something in 10:00  
AM just to make the event spacing work.


Perhaps I'm simply asking the wrong question.  I find that's often the  
case with me.  Creating it with GD would be simple enough, as the idea  
isn't rocket science.  I simply lack time after my current phase to do  
so, which is why I was hoping something intuitive existed so I could  
jump right to it.



To restate, the following does *NOT* apply to any data I have:

X-TIMES(8, 9, 10, 11)
DATA-Y1(200,100,400,600)
DATA-Y2(40,23,12,84)

...as DATA-Y2 didn't log data at 8 and 10, but rather at 8:30 and  
10:30.  Therefore, while I certainly can use an X axis labeled from 8  
am to 11 am, I need different X values for some DATA sets.  I need to  
be able to plot completely independent X,Y values -- and still connect  
them with lines to see trends.  Reasonable, no?



Michael

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php