Plotting into XML pages

  • Thread starter Stephen Jeffrey
  • Start date
S

Stephen Jeffrey

Hi,

I have a CGI script that uses GnuPlot to
dynamically graph data. It works when the
page calling the CGI script is HTML, but
not XML.

Does anyone have any example code that
shows how to plot data using gnuplot
into an XML page?

The following fragment works when graphing
to HTML:

----------------------------------------------------------------
$GNUPLOT = '/usr/bin/gnuplot';

$|=1; # Prevent buffering problems
print "Content-type: image/png\n\n"; # required header

open (GRAPH,"| $GNUPLOT") || die;
print GRAPH <<END;
set term png color small
set output
plot sin(x)
END

close GRAPH;
 
B

Brian McCauley

Stephen said:
I have a CGI script that uses GnuPlot to
dynamically graph data. It works when the
page calling the CGI script is HTML, but
not XML.

I do not think your problem has anything to do with Perl (or CGI). To
help partition your problem try putting a static image/png entity into
your XML.
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top