PDA

View Full Version : charting solution


Robert C
03-31-2004, 02:47 PM
For our pl/sql web app, I am looking for a non-M$ server-side charting
solution for that has an api that takes in data and dynamically generates
gif/jpg charts at run-time
like what you see on finance sites like Yahoo Finance..

Suggestions, anyone ?

Thanks

Ohin

Dave
04-01-2004, 09:04 AM
"Robert C" <rchin@panix.com> wrote in message news:<c4fhnb$9p7$1@reader1.panix.com>... For our pl/sql web app, I am looking for a non-M$ server-side charting solution for that has an api that takes in data and dynamically generates gif/jpg charts at run-time like what you see on finance sites like Yahoo Finance.. Suggestions, anyone ? Thanks Ohin

I have not done this, but I know there are third party Java libaries
for doing this. Try searching for JChart.

Dave

Bricklen
04-01-2004, 09:09 AM
Dave wrote:
"Robert C" <rchin@panix.com> wrote in message news:<c4fhnb$9p7$1@reader1.panix.com>...For our pl/sql web app, I am looking for a non-M$ server-side chartingsolution for that has an api that takes in data and dynamically generatesgif/jpg charts at run-timelike what you see on finance sites like Yahoo Finance..Suggestions, anyone ?ThanksOhin I have not done this, but I know there are third party Java libaries for doing this. Try searching for JChart. Dave
We use GD::Graph for perl from the web quite successfully. There is also
a PHP graph generator that I can't remember the name of.

Grant Mckeen
04-12-2004, 10:03 AM
Dave wrote: "Robert C" <rchin@panix.com> wrote in message news:<c4fhnb$9p7$1@reader1.panix.com>...For our pl/sql web app, I am looking for a non-M$ server-side chartingsolution for that has an api that takes in data and dynamically generatesgif/jpg charts at run-timelike what you see on finance sites like Yahoo Finance..Suggestions, anyone ?ThanksOhin I have not done this, but I know there are third party Java libaries for doing this. Try searching for JChart. Dave
Try using Oracle's 'Chartbuilder' API's. They are a set of Oracle
Classes used for building Graphs.
Try Googling for them.

Robert C
04-12-2004, 10:06 AM
Thanks
google came up with unbelievably little.
Seems like Oracle killed this app before it was really born.
Try using Oracle's 'Chartbuilder' API's. They are a set of Oracle Classes used for building Graphs. Try Googling for them.

Dan Koren
04-12-2004, 05:50 PM
> "Robert C" <rchin@panix.com> wrote in message
news:<c4fhnb$9p7$1@reader1.panix.com>... For our pl/sql web app, I am looking for a non-M$ server-side charting solution for that has an api that takes in data and dynamically generates gif/ jpg charts at run-time like what you see on finance sites like Yahoo Finance.. Suggestions, anyone ?


Check www.softwarefx.com.

Their ChartFX package can
handle almost anything one
can think of.



dk

Sunil
04-12-2004, 09:20 PM
http://otn.oracle.com/products/bib/index.html
look at BI Bean graphs....


"Grant Mckeen" <grant.mckeen@paradise.net.nz> wrote in message
news:VWiec.9551$u%1.847566@news02.tsnz.net... Dave wrote: "Robert C" <rchin@panix.com> wrote in message
news:<c4fhnb$9p7$1@reader1.panix.com>...For our pl/sql web app, I am looking for a non-M$ server-side chartingsolution for that has an api that takes in data and dynamically
generatesgif/jpg charts at run-timelike what you see on finance sites like Yahoo Finance..Suggestions, anyone ?ThanksOhin I have not done this, but I know there are third party Java libaries for doing this. Try searching for JChart. Dave Try using Oracle's 'Chartbuilder' API's. They are a set of Oracle Classes used for building Graphs. Try Googling for them.

Joe
04-13-2004, 02:30 PM
On 03/31/2004 05:47 PM, Robert C said: For our pl/sql web app, I am looking for a non-M$ server-side charting solution for that has an api that takes in data and dynamically generates gif/jpg charts at run-time like what you see on finance sites like Yahoo Finance.. Suggestions, anyone ?

I did something like that by writing a perl program using the module
GD:Graph. I wrote it as a generic graphing CGI program that gets
all of it's data as parameters.

Then in my mod_plsql app, I do all the work to get the data, and
format it as a parameter string that my perl CGI script will accept.
Then still from mod_plsql, I create a web page where the IMG's tag
SRC is a call to the cgi graphic program.

The result is that my mod_plsql program can produce any type of
graph that GD::Graph can.


--
Joe
http://www.joekaz.net/
http://www.cafeshops.com/joekaz

Andy Hassall
04-13-2004, 02:44 PM
On Wed, 31 Mar 2004 17:47:02 -0500, "Robert C" <rchin@panix.com> wrote:
For our pl/sql web app, I am looking for a non-M$ server-side chartingsolution for that has an api that takes in data and dynamically generatesgif/jpg charts at run-timelike what you see on finance sites like Yahoo Finance..Suggestions, anyone ?

Jpgraph (PHP only), GD::Graph (Perl only, quite basic), ChartDirector
(multiple language interfaces) are ones I've tried.

ChartDirector's my current favourite, and has some good looking stock chart
examples on their site.

--
Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space

Robert C
04-13-2004, 03:34 PM
Thank you joe
you wouldn't have the perl code around would you ?
I'd appreciate if you can let me have it.
thanks
rchin@panix.com


"Joe" <nospam@joekaz.net> wrote in message I did something like that by writing a perl program using the module GD:Graph. I wrote it as a generic graphing CGI program that gets all of it's data as parameters. Then in my mod_plsql app, I do all the work to get the data, and format it as a parameter string that my perl CGI script will accept. Then still from mod_plsql, I create a web page where the IMG's tag SRC is a call to the cgi graphic program. The result is that my mod_plsql program can produce any type of graph that GD::Graph can. -- Joe http://www.joekaz.net/ http://www.cafeshops.com/joekaz

Robert C
04-13-2004, 03:53 PM
Thanks all for your suggestions

In summary,
All of the suggestions point to the required knowledge of
one or more of these language or implementation:
Applet : Great Looking, interactive "marketing" charts, no java
required..but it's an applet.
Servelet : Requires Java knowledge, Java container
JSP: Java knowledge
PHP, Perl, Python...
Not exactly suitable for our env - plsql web app off Apache

SVG would be an exellent choice, but requires plug-in & not universally
supported.

However, I was thrilled to find "ploticus" ---- GPL, cost ZERO,
good-old-non-interactive
chart engine written in C - just pipe commandline parameters & produces gif,
jpeg, svg, flash....unbelievable
check it out !

Joe
04-15-2004, 04:03 AM
"Housen" <rchin@panix.com> wrote in message news:<c5htbp$m4a$1@reader2.panix.com>... Thank you joe you wouldn't have the perl code around would you ? I'd appreciate if you can let me have it. thanks rchin@panix.com "Joe" <nospam@joekaz.net> wrote in message I did something like that by writing a perl program using the module GD:Graph. I wrote it as a generic graphing CGI program that gets all of it's data as parameters. Then in my mod_plsql app, I do all the work to get the data, and format it as a parameter string that my perl CGI script will accept. Then still from mod_plsql, I create a web page where the IMG's tag SRC is a call to the cgi graphic program. The result is that my mod_plsql program can produce any type of graph that GD::Graph can.



No problem. The complete perl code is below. It's a simple program,
but could easily be customized for your own needs. This perl code
should go in your webserver's cgi directory. It can go on any
webserver, it doesn't have to be on the same webserver running 9ias
mod_plsql, but it could be.

You could call this directly from a browser like:

http://yourwebserver.com/cgi-bin/simple_graph.pl?hd=2000-05,2000-06,2000-07,2000-08&d1=90,94,86,74&show_values=1

But what you really want to to is use it as IMG tag in another
program. I integrate this with a 9ias mod_plsql app that I use to
graph some Oracle capacity and performance data. From my plsql
procedure, I query my tables to get the data, then format strings for
the data and headings that I want to pass to the simple_graph cgi.
For example - the whole trick is in the IMG tag:

....
htp.p ('<h1>Tablespace Growth</h1>);
htp.p ('show whatever else you need to show.<br>');

-- hd_string and d_string are the heading and data that you want to
graph
-- and this is just an example, for real you will probably create this
-- in a cursor loop from your data:
--
hd_string := '2000-05,2000-06,2000-07,2000-08';
d_string := '90,94,86,74';

gr_ht := '300';
gr_wd := '600';
graph_type := 'lines';
in_sid := 'HR1';
show_values := 0;

htp.p ('<CENTER>');
htp.p ('<img height='||gr_ht||'width='||gr_wd||
' src="' || cgi_path || 'simple_graph.pl' ||
'?height='||gr_ht||'&width='||gr_wd||
'&plot=' || graph_type ||
'&hd=' || hd_string ||
'&d1=' || d_string ||
'&sid=' || in_sid ||
'&show_values=' || show_values ||
'">' );
htp.p ('</CENTER>');
htp.p ('show more regular html if you want to ...');
....


This is the CGI script simple_graph.pl:


#!/usr/local/bin/perl -w
#
# simple_graph.pl
#
# Runs as cgi, all args are optional, but it works better with some
data!
# Used to produce simple graphs in bar, area, lie or line/point
format.
#

use strict;
use CGI qw/:standard/;
use GD::Graph::Data;
use GD::Graph::colour;
use GD;
use GD::Text;

my $HEIGHT = param('height') || '300';
my $WIDTH = param('width') || '400';
my $SID = param('sid') || '?';
my $PLOT = param('plot') || 'bars';
my @D1 = split /,/, (param('d1') || '0');
my @HD = split /,/, (param('hd') || '0');
my $SHOW_VALUES = param('show_values') || '0';
my $xskip = 0;

my $data = GD::Graph::Data->new([ \@HD, \@D1 ]) or die
GD::Graph::Data->error;

# find max value, with some intelligent rounding up to the next big
digit
#
my $max = (sort {$b<=>$a} @D1)[0];
if ($max >10000) { $max = (int($max/10000)+1)*10000 }
elsif ($max >1000) { $max = (int($max/1000)+1)*1000 }
elsif ($max >100) { $max = (int($max/100)+1)*100 }
elsif ($max >10) { $max = (int($max/10)+1)*10 }
else { }

#
# Too many values on the x-axes is hard to read, so space out based on
how
# many there are. This could be improved with recognition of whether
we
# plotting weekly, monthly, or quarterly data.
#
if ($#HD > 20) { $xskip = int($#HD/20) }

my $my_graph;
if ($PLOT eq 'area') {
use GD::Graph::area;
$my_graph = GD::Graph::area->new($WIDTH,$HEIGHT);
} elsif ($PLOT eq 'lines') {
use GD::Graph::lines;
$my_graph = GD::Graph::lines->new($WIDTH,$HEIGHT);
} elsif ($PLOT eq 'linespoints') {
use GD::Graph::linespoints;
$my_graph = GD::Graph::linespoints->new($WIDTH,$HEIGHT);
} else {
use GD::Graph::bars;
$my_graph = GD::Graph::bars->new($WIDTH,$HEIGHT);
}

$my_graph->set(
x_labels_vertical => 1,
y_max_value => $max,
y_tick_number => 10,
long_ticks => 1,
y_label_skip => 2,
x_label_skip => $xskip,
x_all_ticks => 1,
bar_spacing => 4,
shadow_depth => 3,
fgclr => 'gold',
bgclr => 'black',
boxclr => 'white',
accentclr => 'lorange',
shadowclr => 'dblue',
labelclr => 'gold',
axislabelclr => 'gold',
legendclr => 'white',
textclr => 'cyan',
dclrs => [ qw(marine cyan) ],
transparent => 0,
t_margin => 10,
b_margin => 10,
l_margin => 10,
r_margin => 10,
show_values => $SHOW_VALUES,
)
or warn $my_graph->error;

binmode STDOUT;
print header('image/png');
print $my_graph->plot($data)->png;
#
# END
#


--
Joe
http://www.joekaz.net/
http://www.cafeshops.com/joekaz


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service