Jump to content

JFreeChart font issues in PDF


barlindh

Recommended Posts

Hello,

I am having problem displaying text from JFreeCharts in my JasperReport. I am embedding the chart as it is done in the "jfreechart" sample. I can view the chart with titles etc. with "view", but when I export to PDF the titles disappear. The text from the jrxml file is still there.

From what I have read here, I think there is a problem with font embedding, but I am not sure what to do to fix this. Any help is greatly appreciated.

 

I am using JasperReports 3.7.6 on Ubuntu.

I know that it is possible (and probably easier) to generate charts directly in JasperReports as in the "charts" sample code. But I am doing a lot of customization of the charts so I would like to do it in my Java application.

Screenshots of the pdf and JasperViewer are attached.



Post Edited by barlindh at 11/30/2010 14:01
Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

No, I do not know about the JRAbstractChartCustomizer.

 

I have tried to find some more inforamtion, but I have not found anything else except form the JasperReports API. Is it featured in any of the samples included in JasperReports?

 

The class that I make extending JRAbstractChartCustomizer is run by Japserreports as a scriptlet? How do I access it in my jrxml file? An net.sf.jasperreports.engine.JRAbstractChartCustomizer variable inside an ImageExpression tag?

Link to comment
Share on other sites

To narrow down the problem I would try the following:

* Switch your font and then see if it shows up in PDF

* If it still doesn't then export to a different format and see if your font shows up then

As for using a cusomizer class you just have to put the customizer as an attribute called cusomizerClass such as:

<chart evaluationTime="Report" customizerClass="com.my.package.ChartCustomizer">

And then just ensure that the class is on your classpath

Link to comment
Share on other sites

Suddenly I got the fonts working with JRRenderable. Unfortunately I do not know exactly what made it work, but I think it has something to do with the font JFreeChart used.

So right now JRRenderable is serving my needs so I will keep it.

 

Thanks for all your help.

Link to comment
Share on other sites

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