Parang Saraf wrote:
> hey,
>
> I wanted to know about graph plotting engine that is compatible with
> postgres 8.1.4. I am performing some queries like :
> Comparing the speed of three runners namely A, B and C versus time. I
> want to publish the result in a graphical manner on the net instead of
> just providing the data.
>
> So, if you could provide me with some information on how i can do it
> then that would be great.
>
> thanks and regards
> parang saraf
> parang.saraf@gmail.com <mailto:parang.saraf@gmail.com>
I use gnuplot to do that kind of stuff since 1997.
Example for two curves on the same graph :
LANG=fr
LINGUAS=fr
psql editor <<finpsql
set DateStyle ='European';
\t
\o |sed 's/|/ /g' - > plotdata
select distinct d, totblo, utiblo from area where tp='$1' and area =
'EDDON01' and d > 'today'::date-365 order by d;
\o
\q
finpsql
gnuplot <<fingnuplot
set grid
set xdata time
set xtics rotate
set timefmt "%d-%m-%Y"
set data style lines
set ylabel "Blocs"
set format y '%7.0f'
set terminal postscript
set output "|lpr"
set key below
set title "Area EDDON01 machine $1 le `date +'%A %d %B %Y'`"
plot "plotdata" u 1:3 title "Occupation de l'area", "" u 1:2 title
"Taille de l'area"
fingnuplot
This example uses a temporary "plotdata" file.
HTH
--
Patrick