Output a graph as an image

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jm00730
Forum Newbie
Posts: 13
Joined: Tue Feb 01, 2011 1:32 pm

Output a graph as an image

Post by jm00730 »

Hello all, I am using SVGraph to create dynamic graphs based on the user who is logged in. Right now all of my graphs are displayed on the pages within iframes due to the fact that running the $graph->output(); code to display the graph which calls a function that sends the headers and the headers are already sent... my problem is iframes aren't great from what i've been reading, not to mention they are not working with internet explorer. If i could have the graph ouput as an image and then display the image i would not have to use iframes.

Here is the iframe code i curently have which works, but not in internet explorer

Code: Select all

<iframe src="dailyCaloriesPieGraph.php?id=<? echo $id; ?>" width="100%" height="400" frameborder="0" allowtransparency="" seamless="seamless"></iframe>
embed using the following code simply places an image placeholder. like the image is missing;

Code: Select all

<embed src="dailyCaloriesPieGraph.php?id=<? echo $id; ?>" width="100%" height="400" frameborder="0" allowtransparency="" seamless="seamless"></embed>
object simply places an empty window with a scroll bar

Code: Select all

<object type="text/html" data="dailyCaloriesPieGraph.php?id=<? echo $id; ?>" width="100%" height="400"></object>
Anyone know either how to get it to get iframes to work in ie or get these other alternatives working?
Post Reply