2006 IR Open Dicussion Posted August 27, 2006 Share Posted August 27, 2006 By: Dinesh - dinesh_k Changing font size in Chart Legend 2006-04-17 05:34 Can any one help me to change font of Chart Legend By: daloch - rasco RE: Changing font size in Chart Legend 2006-05-15 09:11 I've the same problem Link to comment Share on other sites More sharing options...
kgentile1010 Posted November 15, 2006 Share Posted November 15, 2006 I also have this question. Did you get an answer? Link to comment Share on other sites More sharing options...
Teodor Danciu Posted November 16, 2006 Share Posted November 16, 2006 Hi, Since JR 1.2.7 there is the <chartLegend> tag that lets you specify a font for your legend. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
mano Posted November 28, 2006 Share Posted November 28, 2006 i think that the <chartLegend> tag doesnt work properly. in my MessageBundle i have for example "0x010D"(0xE8 0x010D #LATIN SMALL LETTER C WITH CARON)and changing the font of chart's legend to CP1250 makes this character vanish. some other characters with carons display properly but some dont. the problem is, that in my report (all textfield in CP1250) all of these chars are ok but in the chart the arent displayed. am i doing st wrong? is there any workaround for this? Link to comment Share on other sites More sharing options...
kgentile1010 Posted November 28, 2006 Share Posted November 28, 2006 Hi, In the new version for irReports, you can set it as a chart property. I'm using Jasper Reports/iReport-1.2.8. to get there -- Double click on the chart-- Click on the Chart tab-- Click edit chart properties Go to the parameter -- Legend Font. You can change it here. or you can change it in the jrxml. Here's my Pie Chart xml form the jrxml file. Your JasperReports version needs to be 1.2.7+ <pieChart><chart hyperlinkTarget="Self" customizerClass="TestFormat" ><reportElement x="14" y="13" width="170" height="134" key="element-1"/><box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/><chartLegend textColor="#000000" backgroundColor="#FFFFFF" ><font fontName="SansSerif" pdfFontName="Helvetica" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false" pdfEncoding="Cp1252"/></chartLegend></chart><pieDataset><dataset resetType="Group" resetGroup="Traits" ></dataset><keyExpression><![CDATA[$F{SCORE}]]></keyExpression><valueExpression><![CDATA[$F{COUNT}]]></valueExpression><labelExpression><![CDATA[null]]></labelExpression><sectionHyperlink ></sectionHyperlink></pieDataset><piePlot><plot backcolor="#CCCCFF" /></piePlot></pieChart> I also did try to use the Chart Customizer class. But I'm running into an issue where the first legend isn't modified, in my groups. The second and all subsequent legends do use the 8 font size. Link to comment Share on other sites More sharing options...
mano Posted November 29, 2006 Share Posted November 29, 2006 yes, my chart definition looks the same as yours. i've tried various font names, pdf font names, pdf encodings, but the chart title allways generates the same. in all combinations the title looks identically same!!! maybe its got nothing to do with jasperreports (1.2.8), maybe the problem is in jfreechart or itext. i've browsed thru the jfreechart forum and they advice to set:"org.jfree.report.modules.output.pageable.pdf.Encoding" to "Identity-H" and"org.jfree.report.modules.output.pageable.pdf.EmbedFonts" to "true"but i dont know how to set it in jasper Link to comment Share on other sites More sharing options...
Teodor Danciu Posted December 12, 2006 Share Posted December 12, 2006 Hi, Is this problem appearing only in PDF format?How does the chart look like in the Swing JasperViewer? Thank you,Teodor Link to comment Share on other sites More sharing options...
Teodor Danciu Posted December 12, 2006 Share Posted December 12, 2006 Hi, I suspect you came across a little bug introduced in JR 1.2.8. Fortunately is easy to fix and I suggest you try this: Create a jasperreports.properties file and put it in the root of your application classpath (if you don't have such a file already).Add the following property to this file: net.sf.jasperreports.export.pdf.force.svg.shapes=true Let me know if this solves anything. Thank you,Teodor Link to comment Share on other sites More sharing options...
nnvc Posted October 12, 2009 Share Posted October 12, 2009 HI!!!I am doing a line chart, and I have a lot of values, so the legend is being superimposed, i really don´t know how to solve this.I hope someone can help me,thank you Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now