I've seen the light. =)

I won't jump to javascript charting just yet--although it looks nice
and interaction is great, I don't have the time and it's not required.
Besides, the feeling I get is that I'd probably want to upgrade to
Tap 4.1.something before diving into dojo integration.

It was very easy to switch over to JFreeCharts, although I wish there
were more open source examples besides the pay-for user guide they
offer.

In fact in less than a couple hours I had abstracted my ChartService
to act on a wrapper I called "IChart", which can wrap whatever
charting tool I choose, as long as the chart rendering feature accepts
an output stream.

The IChart class has a method like this that passes render control to
the charting tool it wraps:

public static void writeChartAsJPEG(OutputStream out, IChart chart)
throws IOException {
ChartUtilities.writeChartAsJPEG(out, chart.getChart(),
chart.getWidth(), chart.getHeight());
}

and the ChartService calls this and only has to supply the Chart and
the OutputStream.

The ChartService also reads in height and width from the html (ognl parameters).

Dan


On 1/25/07, Peter Stavrinides <[EMAIL PROTECTED]> wrote:
We use JFreeChart, for both J2EE and Tapestry applications, and I must
say its really simple to use. getting it to work in Tapestry took me a
few days though because I didn't know the framework very well, in the
end it needed a ridiculous amount of code (4 lines or so). I used the
outputstream writer. This snippet is from my IEngineService service()
method:

           JFreeChart freeChart = chart;
           WebResponse response = cycle.getInfrastructure().getResponse();
           OutputStream out = response.getOutputStream(new
ContentType("image/jpeg"));
           ChartUtilities.writeChartAsPNG(out, freeChart, width, 300);


Thiago H de Paula Figueiredo wrote:
> On Wed, 24 Jan 2007 20:03:22 -0200, Martin Strand
> <[EMAIL PROTECTED]> wrote:
>
>> I haven't used it myself but jfreechart appears to be active:
>> http://www.jfree.org/jfreechart/
>
> I have used JFreeChart in some projects and it is very good. It
> supports many chart types (including some you probably never heard of
> before :), it's open source, it's relatively simple to use, and it's
> very powerful. If there isn't any JFreeChart-Tapestry integration
> written yet, it's about time! :) Unfortunately, i don't have the spare
> time needed now. :(
>
> There's Cewolf, a JFreeChart taglib I already used. Maybe we could
> take some ideas from it.
>
> --
> hasta la vista!!!
>
> |8) |8p |8) |8p |8) |8p |8) |8p |8) |8p |8) |8p |8) |8p |8) |8p |8) |8p
>
> thiago h. de paula figueiredo
> mestre em ciência da computação pelo dcc/ufmg
> ate' porque bobagem pouca e' bobagem . . .
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

--
Peter Stavrinides
Albourne Partners (Cyprus) Ltd
Tel: +357 22 750652

If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Please visit http://www.albourne.com/email.html for important 
additional terms relating to this e-mail.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to