NYCPHP Meetup

[nycphp-talk] PHPLot: double dichotomy?

Ophir Prusak prusak at gmail.com
Thu Jan 20 13:01:47 EST 2005


I know this doesn't help you with phplot, but I feel that you'll get
more bang for the buck with this solution that creates the graphs in
flash:

http://www.maani.us/charts/index.php?menu=Introduction

and they'll look SO much nicer :)


On Thu, 20 Jan 2005 12:36:27 -0500, Rahmin Pavlovic
<rahmin at insite-out.com> wrote:
> 
> Here's hoping someone with more experience w/PHPLot than I can help out..
> 
> I'm trying to create a double-dichotomy chart, like this:
> http://insite-out.com/double_dichotomy.html
> 
> I can create the html table above from the database, so now I'm playing around
> with PHPLot to see if I can build a graph out of the data, but I'm having a hard
> time a) customizing the text labels on either axis (it's displaying the numerical
> values anyway) and b) setting lext labels on the y-axis at all, and c) getting
> the x-axis to appear on top.
> 
> I need to play around with the API a bit more, but even when I just use their
> example:
> 
> //Define the object
> $graph =& new PHPlot(300,250);
> 
> //Set titles
> $graph->SetTitle("Title\n\rSubtitle");
> $graph->SetXTitle('X data');
> $graph->SetYTitle('Y data');
> 
> //Define some data
> $example_data = array(
>     array('a',3,4,2),
>     array('b',5,'',1),  // here we have a missing data point, that's ok
>     array('c',7,2,6),
>     array('d',8,1,4),
>     array('e',2,4,6),
>     array('f',6,4,5),
>     array('g',7,2,3)
> );
> $graph->SetDataValues($example_data);
> 
> //Draw it
> $graph->DrawGraph();
> 
> I get numerical data visually interspersed with the text labels.  Doesn't come
> out the way they say it will.  Is there something I'm missing?
> 
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>



More information about the talk mailing list