vattembhaskar Posted March 17, 2009 Share Posted March 17, 2009 Hi to all, while i am generating BAR chart the category axis lables are not in well form i.e they are not directly under the series ...slightly thay are beside to them...plz resolve this,how can i get label as correctly under the figure...Thanx in advance,Vijay..Code:<?xml version="1.0" encoding="UTF-8" ?><!-- Created with iReport - A designer for JasperReports --><!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"><jasperReport name="BarChartsSubReport" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="0" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <field name="accountsOpened" class="java.lang.Long"> <fieldDescription><![CDATA[accountsOpened]]></fieldDescription> </field> <field name="month" class="java.lang.String"> <fieldDescription><![CDATA[month]]></fieldDescription> </field> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="0" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="0" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="0" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="0" isSplitAllowed="true" > </band> </detail> <columnFooter> <band height="0" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="0" isSplitAllowed="true" > </band> </pageFooter> <summary> <band height="411" isSplitAllowed="true" > <barChart> <chart hyperlinkTarget="Self" > <reportElement x="0" y="97" width="535" height="253" key="element-1" positionType="Float"/> <box></box> <chartLegend textColor="#000000" backgroundColor="#FFFFFF" > </chartLegend> </chart> <categoryDataset> <dataset > </dataset> <categorySeries> <seriesExpression><![CDATA[$F{month}]]></seriesExpression> <categoryExpression><![CDATA[$F{month}]]></categoryExpression> <valueExpression><![CDATA[$F{accountsOpened}]]></valueExpression> <itemHyperlink > </itemHyperlink> </categorySeries> </categoryDataset> <barPlot isShowTickMarks="false" > <plot labelRotation="100.0" /> <categoryAxisFormat> <axisFormat tickLabelColor="#009999" > </axisFormat> </categoryAxisFormat> <valueAxisFormat> <axisFormat > </axisFormat> </valueAxisFormat> </barPlot> </barChart> <staticText> <reportElement x="0" y="50" width="358" height="30" key="staticText-1"/> <box></box> <textElement> <font pdfFontName="Helvetica-Bold" size="14" isBold="true" isUnderline="true"/> </textElement> <text><![CDATA[bar Charts:]]></text> </staticText> </band> </summary></jasperReport> Link to comment Share on other sites More sharing options...
ramakrishnanr Posted March 17, 2009 Share Posted March 17, 2009 Try to change the font of your category axis label and see if it helps. The attribute to change is "Category Axis Tick Label Font". Link to comment Share on other sites More sharing options...
vattembhaskar Posted March 17, 2009 Author Share Posted March 17, 2009 Thanx to ur reply i tried but it is not coming...can u give me another way to try? Link to comment Share on other sites More sharing options...
ramakrishnanr Posted March 17, 2009 Share Posted March 17, 2009 It depends on various factors. For example, the width of your chart and the number of labels in your category axis, 1 or 10. Also, i see a category axis label rotation as 100. Change it to 0 to see if it works without label rotation. you can also try to change the chart orientation and see if that helps. Link to comment Share on other sites More sharing options...
vattembhaskar Posted March 17, 2009 Author Share Posted March 17, 2009 Yes boss! i tried even this also by increasing width and removing label rotation value and all...but not...but how can we get this exactly[with out depend on your specified parameters]...? Link to comment Share on other sites More sharing options...
mdahlman Posted March 21, 2009 Share Posted March 21, 2009 vattembhaskar, It looks like you have made one of the most common mistakes. It should be easy to fix. Your series is $F{month} and your category is $F{month} as well. This doesn't make sense. Change the series to "MySeries" and leave the category as $F{month}. Try the reverse as well. Set the series as $F{month} and the category as "MyCategory". It should help to understand what's going on. Please let us know if that solves it. Regards,Matt Link to comment Share on other sites More sharing options...
vattembhaskar Posted March 25, 2009 Author Share Posted March 25, 2009 Hello mdahlman , thanx for ur reply but do you know the difference between Series and Category expressions exactly?..let me know that at first...i am newer for this that's why i am asking this .. Thanx in advance,vijay Link to comment Share on other sites More sharing options...
teamireport Posted November 19, 2009 Share Posted November 19, 2009 Matt, thanks for your solution on this .. i also ran into this problem , now resolved after reading this topic. 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