OK, on the most general level, here's what I need to do:

>From a servlet, create a graph (i.e. a bar chart/histogram, possibly
with some lines drawn over it), and then save it to a file in some
image/graphics format (e.g. gif, jpeg), so I can include it in an IMG
tag in an HTML file (likely dynamicaly generated, but I don't think
that matters).  FYI, the web server/servlet engine is running on an
AIX machine.

There is an example of something like this in Java Servlet
Programming.  It uses a third party commercial package (VE's BarChart)
to create the graph and then Acme's GifEncoder class to create the gif
image, which is then sent to the browser.  I assume it would not be
difficult to change this so that it writes it to a file instead
(e.g. use a FileOutputStream instead of a ServletOutputStream).

One complication of this approach is that you need to be running an X
server (or something like Xvfb).  This may turn out to be a problem
for my usage.  From what I've read, there doesn't appear to to be any
way to use this kind of solution without having an X server or Xvfb --
anyone know otherwise?  Also, it is unclear whether I'll be able to
draw lines on top of a bar chart -- this probably depends on the
capabilities of the charting package.

Another solution I can envision is having a Java API to some graphics
library/package (e.g. gd at http://www.boutell.com/) that can handle
drawing graphs and lines and creating the gif/jpeg (gd actually does
the latter but not the former).  I haven't been able to find such a
beast though -- anyone know of one?

And possibly there are some other solutions that I haven't thought of.

To make things a little more complicated :-), I'd like to find a
solution that is low-cost, hopefully free -- one thing that helps
there is that this is for non-commercial/educational use.

Thanks very much for any help/suggestions.

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to