generate dynamic linechart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
gs

generate dynamic linechart

Post by gs » Fri May 11, 2001 10:09 am

Hi!

Im having problems with my java servlet. Im trying to generate a dynamic line chart.. the servlet code:
JFreeChart chart = createChart(dataset);
int width = 400;
int height = 300;
BufferedImage img = draw( chart, width, height );

OutputStream o = response.getOutputStream();
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(o);
JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(img);
param.setQuality(1.0f,true);
encoder.encode(img,param);
o.close();

When I try to open the servlet in my browser I get this error:
"HTTP 404 - File not found"

When I try to do the same thing with a "normal" image, the code above works..
I tried to write the CategoryDataSource getsSeriesCount() in this image but then the same error occured...

I'd be gratefull for any help here!!

David Gilbert

RE: generate dynamic linechart

Post by David Gilbert » Tue May 15, 2001 12:38 pm

That seems pretty strange - I can't think of a reason why an image created using the JFreeChart draw() method should be any different to a regular image...anyone else?

DG.

Locked