Re: WAS: Use php to plot graph. NOW: ASCII GRAPH CONTEST
| From: | Daniel Barton | Date: | Mon, 03 Dec 2001 17:00:04 +0000 |
| Subject: | Re: WAS: Use php to plot graph. NOW: ASCII GRAPH CONTEST | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14772@lists.php.net to get a copy of this message | ||
The method I used for ascii graphs was based on some C program I wrote that
created an array, which was, in essence, the graph. Each array element was two
characters wide (we''l see why..) The first column of the array is all |, to make
a Y axis, and the last row if the array is all _, to make an X axis. Then there
were two other arrays, for labels, that were stuck along side or below the axes
(dynamic). The first array is modified based on the data, using O, -, |, \ and /
in goofy combinations to draw lines. Then I characterized characters (heehee) as
either wide, or narrow, to avoid width problems, and when it's a "narrow"
character you insert a space to avoid problems with lines not lining up. Then,
spit the array out to the display. Whheeeee fun.
We should have an "ASCII/PHP/Database Graphing Contest." I'll host it if there
are interested contestants. Suggested design: HTML form for data input, passes to
PHP script for immediate (and STYLIN') ascii output. Any takers?
Will post the code/output example when I have a free moment...
Bas Jobsen wrote:
> Hi,
>
> > 4) Program some really slick ascii graphs. No joke, I did this a while ago.
> > Nice output. Really fast. You can do line graphs, too.
>
> Intressting. Do you have an example?
>
> Tnx,
>
> Bas
>
>
--
----------
Dan Barton
Terrestrial Program Biologist
Asst. Data Manager
Point Reyes Bird Observatory
http://www.prbo.org
dbarton@prbo.org
dbarton@grayflycatcher.org