sfergus1 Posted November 30, 2012 Share Posted November 30, 2012 I have a bar graph with labels rotated a -45 degrees to read on an upward slope, left to right. When I run it in preview mode in iReport it looks fine (see preview.pdf attachment), with all of the labels up against the bottom of the bar graph. When I run it through our Jasper server, the labels appear to be left-aligned instead of right-aligned.. They're all pulled away from the horizontal axis, apparently ragged in their alignment, and the leftmost label is getting cut off (see final.pdf attachment).I do have a chart customizer class for this document, which I use to color the positive values green and the negative ones red, keeping them all in a single series so I don't have to plot empty bars. As part of this I have a custom bar renderer subclass. However, I think I'm copying all of the relevant parameters in the constructor of my class (shown below), and I'm using the same jar file both with iReport and on the Jaspewr Reports server. public CustomBarRenderer(BarRenderer barRenderer, Paint[] colors) { this.colors = colors; // Copy settings for item labels this.setBaseItemLabelsVisible(barRenderer.getBaseItemLabelsVisible()); this.setBasePositiveItemLabelPosition(barRenderer.getBasePositiveItemLabelPosition()); this.setBaseNegativeItemLabelPosition(barRenderer.getBaseNegativeItemLabelPosition()); this.setBaseItemLabelFont(barRenderer.getBaseItemLabelFont()); this.setBaseItemLabelPaint(barRenderer.getBaseItemLabelPaint()); this.setBaseItemLabelGenerator(barRenderer.getBaseItemLabelGenerator()); // Copy other display settings this.setShadowVisible(barRenderer.getShadowsVisible()); this.setMaximumBarWidth(.02); } My JRXML for defining the category labels looks like this: I don't see any attributes I can set to change from left to right aligned in the XML schema.Any suggestions on how to correct this label alignment issue would be most appreciated.Thanks, Steve Link to comment Share on other sites More sharing options...
sfergus1 Posted November 30, 2012 Author Share Posted November 30, 2012 It looks like the XML didn't get escaped. Let's try that again. Link to comment Share on other sites More sharing options...
Teodor Danciu Posted December 4, 2012 Share Posted December 4, 2012 Hi, Can you attach the JRXML file to this thread. Thanks, Teodor Link to comment Share on other sites More sharing options...
Solution sfergus1 Posted December 5, 2012 Author Solution Share Posted December 5, 2012 It looks like the problem was likely a build issue. I think the exported font jar file the report expected wasn't included in the build, and the report was falling back to Helvetica, which was causing the positioning to be off. I ran another report this morning and it appears okay. 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