Template::Plugin::GD - drawing graph

A

AC

Hi

There's probably a very trivial answer to my question but I just can't
find it.
I'm trying to incorporate a line graph into a webpage by:

<html>
<body>
<table> ....</table>
[%
FILTER null;
USE im = GD.Graph.lines();
...
...
im.plot(data).png | stdout(1);
END;
%]
</body>
</html>

-----------------------
-- Problem: --
-----------------------
When using stdout(1):
* webpage content: will not show
* graph: will show

Without using the stdout(1):
* webpage content: will show
* graph: will not show

Is there a way of making both the webpage content and graph visible?


Thanks
AC
 
B

Ben Morrow

Quoth "AC said:
Hi

There's probably a very trivial answer to my question but I just can't
find it.
I'm trying to incorporate a line graph into a webpage by:

<html>
<body>
<table> ....</table>
[%
FILTER null;
USE im = GD.Graph.lines();
...
...
im.plot(data).png | stdout(1);
END;
%]

You need to take a step back and learn how HTML works. The image has to
be available at a separate URL that you then reference in the HTML page.
In principle you can include in inline with the data: URI scheme, but
this is not widely supported in browsers (for which read IE).
</body>
</html>

Because you have an invalid HTML page with a whole lot of binary data in
the middle of it.
Without using the stdout(1):
* webpage content: will show
* graph: will not show

Because you have a valid HTML page and the output has gone nowhere.
Is there a way of making both the webpage content and graph visible?

You need two template files, or one that accepts some sort of parameter.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top