Re: [GENERAL] Creating web images from postgres data - Mailing list pgsql-general

From Oleg Broytmann
Subject Re: [GENERAL] Creating web images from postgres data
Date
Msg-id Pine.SOL2.3.96.SK.981028153413.21439C-100000@sun.med.ru
Whole thread Raw
In response to Creating web images from postgres data  (Lincoln Spiteri <lincoln.spiteri@st.com>)
List pgsql-general
Hi!

On Wed, 28 Oct 1998, Lincoln Spiteri wrote:
> I am currently starting up a pilot project to demonstrate the power of
> the linux/postgres/php trio in an enterprise setting.
>
> I would like to be able to output graphs from data stored in a postgres
> table for viewing on a web  browser as a means of data presentation.
> Could anyone give me some suggestions as to what the best approach would
> be to achieve this.

   As you already have (or will have in the near future) php, I want to
stress there is php<->gd interface (gd is GIF drawing library). You should
write plotting program by youself.

   Another solution is to use gnuplot program. The gnuplot solution is much
simpler, but there are drawbacks - often gnuplot is TOO simple.

Example.
   This is datafile (data you drawn from database):
21 12 12
22 12 10
23 12 12
24 14 16
25 14 17
26 15 18
27 16 18.5
28 17 21
29 20 25
30 18 24

   This datafile means: data for 21, 22, ..., 30 June are:
21 June: min = 12, max = 12... and so on.
   This is command file you feed into gnuplot's stdin:
set term pbm color
plot  "demo-gif.dat" using "%f%f"    title "Min" with linespoints, \
      "demo-gif.dat" using "%f%*f%f" title "Max" with linespoints

   After this, gnuplot will generate ppm file on stdout. Filter it through
ppmchange (to correct colors) and ppmtogif to produce GIF. To make results
a bit nicer, make the GIF transparent (ppmtogif -transparent) and put the
GIF onto nice HTML background.
   Latest version of gnuplot can be linked with gd library and can produce
GIF files without intermediate ppm.

   Example in the real world: http://rinaco.ice.ru/analytics/q_c/
Generated with gnuplot.

Oleg.
----
    Oleg Broytmann  National Research Surgery Centre  http://sun.med.ru/~phd/
           Programmers don't die, they just GOSUB without RETURN.



pgsql-general by date:

Previous
From: Herouth Maoz
Date:
Subject: Re: [GENERAL] Getting input from email...
Next
From: "Jackson, DeJuan"
Date:
Subject: RE: [GENERAL] Creating web images from postgres data