You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Luca Morandini <sp...@ipzs.it> on 2002/10/22 15:11:33 UTC

[SUMMARY] JFreeChart, anyone ?

Folks,

first, I'd like to thank all the people who kindly answered my call.

However, the project I'm currently involved needs something else than a
serializer, and something more flexible than Krysalis-Wings, therefore:

1) We'd like to build a transformer (chart definition and chart data in, SVG
out) from scratch (the resulting SVG may be serialized as PNG or JPEG later
in the pipeline)
2) We'll use JFreeChart (our customer likes it, moreover, we deem it more
powerful than JChart)
3) We'll develop the code for Pie, Bar and Stacked bar charts only; but we
hope to provide a good code base to build upon
4) Our customer (Istituto Poligrafico e Zecca dello Stato
http://www.ipzs.it ) would like to donate the resulting software (the
Transformer).
5) We'll develop it in the next couple of weeks
6) We'll build it using Cocoon 2.0.2

Let me know if someone has some comments/suggestions on it. Particularly,
I'd like to know whether it could be built as a Cocoon block (and how).

Best regards,

Luca Morandini
spectrum.morandini@ipzs.it
lmorandini@ieee.org



     We are protected from the virus by Norton Antivirus Corporate Edition

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


R: [SUMMARY] JFreeChart, anyone ?

Posted by Luca Morandini <sp...@ipzs.it>.
Hugo,

the use of an extractor/generator seems to us a little bit convoluted... a
Transformer will sit more confortably in the pipeline. However, in case of
multiple images on the same page, your solution would probably be faster: we
understand there are more ways to skin a cat :)

Another thing: the XML dictionary you use is based on the assumption that
values are linked to categories and series based on their position, an
assumption we'd like to dispense with.

Thanks for your contribute !

P.S.
Here's an example of our draft XML dictionary (as you may notice, values are
linked to catrogies and series by ids)

<?xml version="1.0" encoding="iso-8859-1"?>
<chart:chart xmlns:chart="http://ipzs.it/chart">
	<chart:definition>
		<chart:properties
			type="bar"
			title="Sales and Inventory 2001"
			width="300"
			height="300"
			xaxislabel="Months"
			yaxislabel="Million EUR"/>
		<chart:seriesdefinition>
			<chart:series id="sales"
				title="Sales"
				color="0 0 255"/>
			<chart:series id="inventory"
				title="Inventory"
				color="255 0 0"/>
		</chart:seriesdefinition>
	</chart:definition>
	<chart:dataset>
		<chart:categories>
			<chart:category id="1" label="January"/>
			<chart:category id="2" label="February"/>
			<chart:category id="3" label="March"/>
		</chart:categories>
		<chart:seriesdata>
			<chart:seriesgroup series="sales">
				<chart:item category="1" value="20"/>
				<chart:item category="2" value="25"/>
				<chart:item category="3" value="32"/>
			</chart:seriesgroup>
			<chart:seriesgroup series="inventory">
				<chart:item category="1" value="40"/>
				<chart:item category="3" value="47"/>
			</chart:seriesgroup>
		</chart:seriesdata>
	</chart:dataset>
</chart:chart>

Luca Morandini
Istituto Poligrafico e Zecca dello Stato
lmorandini@ieee.org
spectrum.morandini@ipzs.it


> -----Messaggio originale-----
> Da: Hugo Burm [mailto:hugob@xs4all.nl]
> Inviato: mercoledì 23 ottobre 2002 9.51
> A: cocoon-dev@xml.apache.org
> Cc: Giaimo Pino
> Oggetto: RE: [SUMMARY] JFreeChart, anyone ?
>
>
> Hello,
>
> I have an application working that uses an extractor and a reader
> instead of
> a transformer.
> It works exactly like the SVG extractor example.
>
> In the xml source you can have something like:
> (the example below defines a chart with two categories and series of four,
> the data points are hard coded here. In the real app they are
> retreived from
> a database)
>
> <jfc width="400" height="320" xmlns="http://datagram.nl/survey">
> 	<title> This is a test title</title>
> 	<type>1</type>
> 	<category-title>Uw score</category-title>
> 	<category-title>Gemiddeld</category-title>
> 	<serie-title>Niet beantwoord</serie-title>
> 	<serie-title>Geen risico</serie-title>
> 	<serie-title>Aanvaardbaar risico</serie-title>
> 	<serie-title>Te hoog risico</serie-title>
> 	<category>73,20,50,10</category>
> 	<category>23,70,30,20</category>
> </jfc>
>
> The standard Cocoon extractor (the one that is used for SVG) extracts it
> into a separate pipeline.
> That pipeline consists of a reader that reads the jfc fragment
> and creates a
> jfree chart (at the moment png).
> Just like in the SVG example, an xsl transformation is used to replace the
> jfc fragment in the original xml document with a link.
> The browser replaces the link with the rendered jfree chart.
> Sounds complex.
> But if you understand the SVG extractor example, it is straightforward.
>
> At the moment it is working for html and pdf output, but only for
> (stacked)
> bars. And no error handling yet etc. I need some more time to implement a
> better jfc chart definition (see the jfc tag above) and a better
> parser for
> this.
>
> And I am now working on a reader that creates SVG instead of PNG (should
> look better when incorporated in pdf output). This is straightforward
> because I have some example code from jfree chart.
>
> And, as always, I am struggling with the cache monster...
>
> Hugo
> hugob@datagram.nl
>
>



     We are protected from the virus by Norton Antivirus Corporate Edition

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: [SUMMARY] JFreeChart, anyone ?

Posted by Hugo Burm <hu...@xs4all.nl>.
Hello,

I have an application working that uses an extractor and a reader instead of
a transformer.
It works exactly like the SVG extractor example.

In the xml source you can have something like:
(the example below defines a chart with two categories and series of four,
the data points are hard coded here. In the real app they are retreived from
a database)

<jfc width="400" height="320" xmlns="http://datagram.nl/survey">
	<title> This is a test title</title>
	<type>1</type>
	<category-title>Uw score</category-title>
	<category-title>Gemiddeld</category-title>
	<serie-title>Niet beantwoord</serie-title>
	<serie-title>Geen risico</serie-title>
	<serie-title>Aanvaardbaar risico</serie-title>
	<serie-title>Te hoog risico</serie-title>
	<category>73,20,50,10</category>
	<category>23,70,30,20</category>
</jfc>

The standard Cocoon extractor (the one that is used for SVG) extracts it
into a separate pipeline.
That pipeline consists of a reader that reads the jfc fragment and creates a
jfree chart (at the moment png).
Just like in the SVG example, an xsl transformation is used to replace the
jfc fragment in the original xml document with a link.
The browser replaces the link with the rendered jfree chart. Sounds complex.
But if you understand the SVG extractor example, it is straightforward.

At the moment it is working for html and pdf output, but only for (stacked)
bars. And no error handling yet etc. I need some more time to implement a
better jfc chart definition (see the jfc tag above) and a better parser for
this.

And I am now working on a reader that creates SVG instead of PNG (should
look better when incorporated in pdf output). This is straightforward
because I have some example code from jfree chart.

And, as always, I am struggling with the cache monster...

Hugo
hugob@datagram.nl


-----Original Message-----
From: Luca Morandini [mailto:spectrum.morandini@ipzs.it]
Sent: Tuesday, October 22, 2002 3:12 PM
To: cocoon-dev@xml.apache.org; cocoon-users@xml.apache.org
Cc: Giaimo Pino
Subject: [SUMMARY] JFreeChart, anyone ?


Folks,

first, I'd like to thank all the people who kindly answered my call.

However, the project I'm currently involved needs something else than a
serializer, and something more flexible than Krysalis-Wings, therefore:

1) We'd like to build a transformer (chart definition and chart data in, SVG
out) from scratch (the resulting SVG may be serialized as PNG or JPEG later
in the pipeline)
2) We'll use JFreeChart (our customer likes it, moreover, we deem it more
powerful than JChart)
3) We'll develop the code for Pie, Bar and Stacked bar charts only; but we
hope to provide a good code base to build upon
4) Our customer (Istituto Poligrafico e Zecca dello Stato
http://www.ipzs.it ) would like to donate the resulting software (the
Transformer).
5) We'll develop it in the next couple of weeks
6) We'll build it using Cocoon 2.0.2

Let me know if someone has some comments/suggestions on it. Particularly,
I'd like to know whether it could be built as a Cocoon block (and how).

Best regards,

Luca Morandini
spectrum.morandini@ipzs.it
lmorandini@ieee.org



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org