I first went the route of creating JPGs (or was it GIFs) and referencing
them as external graphics, but they were quite cumbersome and a little bit
"ugly."  I have since changed to creating SVG from a java class and then
embedding that in my XML.  Fop does a pretty good job of adding them to the
PDF.

However, writing a graph generator is not that easy a thing.  I still
sporadically address different issues that pop up (mostly scaling, text
formatting, and the like).  You may want to consider looking into a
prewritten solution.

If you really want to write your own, I can post some of my "gotchas" so
you don't have to start from scratch.

-Lou



                                                                                
                                                                   
                      [EMAIL PROTECTED]                                         
                                                                    
                      m                        To:      
[email protected]                                                
           
                                               cc:                              
                                                                   
                      04/15/2005 11:50         Subject: Re: Need info           
                                                                   
                      Please respond                                            
                                                                   
                      to fop-users                                              
                                                                   
                                                                                
                                                                   
                                                                                
                                                                   



I can think of three ways, each one successively more painful than the
previous:

1. Draw it in a drawing applications and pick it up with
fo:external-graphic.

2. Create an SVG.

3. Create a table.

More about doing this as a table. Provided your data is pretty simple, you
can create a bar chart by coloring cells in a largish table, thus:

-----------------
|   | |   | |   |
| X | |   | |   |
| X | |   | |   |
| X | |   | |   |
| X | |   | |   |
| X | |   | | X |
| X | |   | | X |
| X | | X | | X |
| X | | X | | X |
| X | | X | | X |
-----------------
(where X marks a cell you should color)

The table trick will very quickly become hard to implement if you have
much data or if you have fine gradation within the data (for example,
where the difference between 88% and 89% matters).

This kind of thing is called a "text illustration" and comes from the days
when technical writers had nothing but typewriters (just before my time -
I got started with the first generation of word processing software,
fortunately for me). Some of those old text illustrations were quite
effective. A good grasp of the data and what needs to be communicated goes
a long way, regardless of how spiffy the end result appears.

(By the way, I've drawn boundaries here to show the table structure.
However, graphics should generally minimize boundaries - reducing what
Edward Tufte calls "chart junk" - and focus on the data. Of course, Tufte
would also tell you that a bar chart is a pretty poor means of presenting
data and that a good table would work better. But now we are off on a
whole 'nother subject: information design, which fascinates me but isn't
on topic here.)

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)





"Seshamma Venkata C" <[EMAIL PROTECTED]>
04/15/2005 03:45 AM
Please respond to
[email protected]


To
<[EMAIL PROTECTED]>
cc

Subject
Need info






Hello,

I am working with FOP and new to this.Can u please tell me how can i
create a bar chart using FOP.

Regards,
Seshamma
Sr.Software Engineer
===========================================================================
Sobha Renaissance Information Technology Private Limited
An SEI-CMM & P-CMM Level 5 Company
World's 1st SSE-CMM Level 5 Company
BS 7799 certified by British Standards Institute
ISO 9001:2000 Certified by T�V Rheinland/Berlin-Brandenburg
A Six Sigma Practice Company
Tel: + 91 80 51951999; Fax: + 91 80 51523300; Video Conference: + 91 80
51252222
Email :[EMAIL PROTECTED]; Web: www.renaissance-it.com
===========================================================================

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete all copies from any
computer.



---------------------------------------------------------------------
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