|  | Posted by Andrew @ Rockface on 07/02/05 12:55 
shawn wrote:> Hi,
 >
 > I downloaded a piegraph class from phpclasses.org
 > (http://www.phpclasses.org/browse/file/9316.html) and was able to show the
 > sample pie graph. However if I include it directly in my code all are
 > gibberish. I need to use <embed src="myfiles/pie.php"> to display it using
 > browser's plug-in. In my case, Quicktime was the one to handle the phg
 > format.
 >
 > The problem is: this works only on machine where Quicktime is already in
 > place. If a browser doesn't have a png handler, for example without
 > Quicktime, the embed simply displays as an empty image box. I was trying to
 > add some parameter to the code like below:
 >
 > <embed src="pie.php" width="300" height="100" MIME-Type="image/x-png;
 > image/png">
 >
 > but it didn't see to have any impact.
 >
 > I can't ask visitors to install Quicktime on their machines. All I wanted is
 > to be able to show this dynamic generated png image in a php web page. Could
 > someone tell me what I have not done right here and what is the proper way
 > of doing this?
 
 No idea why you need to embed anything. Here's the example you pointed at:
 
 <?
 require("piegraph.class.php");
 
 // class call with the width, height & data
 $pie = new PieGraph(200, 100, array(231,122,32,54));
 
 // colors for the data
 $pie->setColors(array("#ff0000","#ff8800","#0022ff","#33ff33"));
 
 // legends for the data
 $pie->setLegends(array("Internet Explorer","Mozilla
 Firefox","Opera","Netscape"));
 
 // Display creation time of the graph
 $pie->DisplayCreationTime();
 
 // Height of the pie 3d effect
 $pie->set3dHeight(15);
 
 // Display the graph
 $pie->display();
 ?>
 
 Nothing there about quicktime or embedding. Just create a file called
 test.php, cut and paste the above code into the file. open the file with
 your browser of choice. All this is assuming you have php installed -
 you do have php installed don't you?
 
 --
 Andrew @ Rockface
 www.rockface-records.co.uk
 "Pablo Picasso never got called an asshole"
  Navigation: [Reply to this message] |