|
Posted by Sherm Pendley on May 14, 2005, 4:58 am
Please log in for more thread options
Colin Walls wrote:
> I have developed an application using CGI::Application and HTML::Template.
> Some of the run modes in the application use GD:Graph to present charts.
>
> In the GD:Graph documentation they simply write graphical information to
> STDOUT to present the information to a web page. I can't work out whether
> this is possible using HTML::Template, and if it is, how to do it. As a
> result I am writing the charts to a file and using a standard image tag in
> my template file.
>
> Is it possible to write present a GD:Graph chart without writing a file in
> this scenario?
Yes, but probably not in the way you're thinking. There's no getting
around the fact that the user agent will be making a second, entirely
separate request for the image data. So you can't print the image and
HTML as part of the same request.
What you can do is, within the HTML::Template CGI, construct an img
element whose src attribute points to a second CGI that prints the
image, and includes in the query string any parameters that one will
need to do its job.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net Hire me! My resume: http://www.dot-app.org
|