Jump to content
We've recently updated our Privacy Statement, available here ×

Integrate Charts as Vector Graphics?


ktrinad

Recommended Posts

By: Christian Haul - chaul

Integrate Charts as Vector Graphics?

2004-05-14 00:39

 

Hi all,

After having integrated jfreecharts sucessfully into my reports by writing two generic scriptlets I'm a little disappointed that apparently I have to use a bitmapped image although the charts library can produce SVG or PDF as jasperreports can do as well.

 

Well, actually, neither supports SVG or PDF natively, but by drawing on a suitable Graphics2D object provided by apache batik or itext both can produce SVG or PDF.

 

Since I'm quite new to both jasperreports and jfreecharts I'd like to hear some advice on how to best proceed. Obviously, I'd like to produce best quality PDF and SVG output from jasperreports including charts.

 

So far, the best solution I can think of is to replace the internal representation of images as array of bytes in jasperreports with a SVG DOM. Consequently, passing the image data around needs to use org.w3c.dom.Document (or Node) instead of byte[]. However, this would introduce a dependency on apache batik since in the end batik would be needed to draw the image either on an itext Graphics2D object when exporting to PDF or to a real AWT Graphics2D or again a SVGGraphics2D for inclusion in a produced SVG or ...

 

In exchange, it would make it a little nicer to include images inline in a report definition XML.

 

Changing the internal representation to SVG DOM would require changes to the jasperreports core classes at a number of places. Would a patch doing this have a chance of being accepted? Thought, ideas?

 

Chris.

 

 

 

By: Lars Kristensen - llk

RE: Integrate Charts as Vector Graphics?

2004-05-14 01:01

Se the patch 'Vector graphics (inc. chart) support' and the later updates in the patch section: https://sourceforge.net/tracker/?group_id=36382&atid=416705

 

I have used the patch with great results.

 

Best Regards

llk

 

 

By: Christian Haul - chaul

RE: Integrate Charts as Vector Graphics?

2004-05-14 02:31

Great! Absolutely fabulous! Works like a charm.

Applying the patch to 0.5.2 needed a high fuzz factor and one import statement did not apply cleanly. But other than that it was painless. I have even added the Rendable type to my local ireporter copy :-)

 

Cheers for pointing me to this patch. Hope it's going to be incorporated soon.

 

 

By: Jian Zhou - efly

RE: Integrate Charts as Vector Graphics?

2004-05-17 19:11

Fantastic idea! Uses iText pdfTemplate of Graphices2D. I have worked it out for Chinese fonts support in version 0.5.2 with little patch of iText.

Link to comment
Share on other sites

  • 6 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...