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;
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;