|
Posted by Rik on 07/17/06 20:14
Shawn Hamzee wrote:
Don't toppost
> <andy@andyh.co.uk> wrote:
>> <hamzee@sbcglobal.net.INVALID> wrote:
>>> I am having a problem with Image_Graph on php 5.1.4. I installed
>>> the package and all of its dependencies through pear installer
>>> without any hitches. Then I started to add some very simple code to
>>> create a graph in an existing php page. I added the code for the
>>> graph and added the elements of it plus some static data. However,
>>> when I browse the page, I get garbled data instead of the graph.
>>> Has anyone ever run into this problem. I am testing this on an xp
>>> test bed for now.
>>>
>>> I am thinking the fact that I'm getting garbled data means that the
>>> class creation has gone well; however rendering the graph is not
>>> happening for some reason.
>>
>> Have you output an appropriate Content-type header for the image
>> format you're
>> using?
> Actually, I just found out what is going on:
> In order to use image_graph, one cannot have both a graph and html
> (php generated or otherwise) on the same page.
>
> So in order to get around this, you'll have to save the graph to an
> image
> file (.png) and then echo a link in the script for it.
Not really.
You could save the portion of your script that makes the graph something
like graphcreator.php, and echo that as the source for your image. That way
it will always stay up to date without any constant diskwriting. Depending
on how much people will see the graph storing it and refreshing it
periodically could save some overhead. If it's just some statistics a few
people will check out a couple of times per week I'd keep it totally
dynamic.
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|