How to reduce the gap between two columns

0

HI,

I am pretty much new to iReport. I need help for reducing the gap between two columns of the bar chart in the generated graph.

The problem is that the there is a line chart present in the graph also. But when there is no value for the line chart still there is a blank space between the two columns of bar chart which I think is the place holder for the line chart.

Can somebody help regarding this problem, my requirement is just to reduce the gap between the two columns while representing ??

Please refer the attached files for the clear picture on the graph.

 

Thanks in advance.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports <a target="_blank" href="http://jasperreports.sourceforge.net/xsd/jasperreport.xsd""><a href="http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"" target="_blank">http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"</a></a> name="niguriChartWithLSTDays" language="java" pageWidth="0" pageHeight="350" columnWidth="0" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<parameter name="range" class="java.lang.Integer"/>
	<field name="month" class="java.lang.String"/>
	<field name="tanki" class="java.lang.Integer"/>
	<field name="rs" class="java.lang.Integer"/>
	<field name="landedStock" class="java.lang.Integer"/>
	<field name="landedStockDays" class="java.lang.Integer"/>
	<field name="landedStkDaysTarget" class="java.lang.Integer"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="300" splitType="Stretch">
			<multiAxisChart>
				<chart isShowLegend="true" evaluationTime="Report">
					<reportElement key="graphWidthKey" x="0" y="0" width="0" height="300"/>
					<chartTitle/>
					<chartSubtitle/>
					<chartLegend position="Top"/>
				</chart>
				<multiAxisPlot>
					<plot/>
					<axis>
						<barChart>
							<chart isShowLegend="true">
								<reportElement x="0" y="0" width="0" height="0" backcolor="#FFFFFF"/>
								<chartTitle color="#000000"/>
								<chartSubtitle color="#000000"/>
								<chartLegend textColor="#000000" backgroundColor="#FFFFFF" position="Top"/>
							</chart>
							<categoryDataset>
								<categorySeries>
									<seriesExpression><![CDATA["Tanki"]]></seriesExpression>
									<categoryExpression><![CDATA[$F{month}]]></categoryExpression>
									<valueExpression><![CDATA[$F{tanki}]]></valueExpression>
								</categorySeries>
								<categorySeries>
									<seriesExpression><![CDATA["Registrations"]]></seriesExpression>
									<categoryExpression><![CDATA[$F{month}]]></categoryExpression>
									<valueExpression><![CDATA[$F{rs}]]></valueExpression>
								</categorySeries>
							</categoryDataset>
							<barPlot>
								<plot>
									<seriesColor seriesOrder="0" color="#9F3F3F"/>
									<seriesColor seriesOrder="1" color="#3399FF"/>
								</plot>
								<itemLabel color="#000000" backgroundColor="#FFFFFF"/>
								<categoryAxisFormat>
									<axisFormat>
										<labelFont/>
										<tickLabelFont/>
									</axisFormat>
								</categoryAxisFormat>
								<valueAxisLabelExpression><![CDATA["UNITS"]]></valueAxisLabelExpression>
								<valueAxisFormat>
									<axisFormat>
										<labelFont>
											<font fontName="Arial" size="8" isBold="true"/>
										</labelFont>
										<tickLabelFont/>
									</axisFormat>
								</valueAxisFormat>
								<rangeAxisMinValueExpression><![CDATA[new Integer(0)]]></rangeAxisMinValueExpression>
								<rangeAxisMaxValueExpression><![CDATA[$P{range}]]></rangeAxisMaxValueExpression>
							</barPlot>
						</barChart>
					</axis>
					<axis>
						<lineChart>
							<chart isShowLegend="true">
								<reportElement x="0" y="0" width="0" height="0" backcolor="#FFFFFF"/>
								<chartTitle color="#000000"/>
								<chartSubtitle color="#000000"/>
								<chartLegend textColor="#000000" backgroundColor="#FFFFFF" position="Top"/>
							</chart>
							<categoryDataset>
								<categorySeries>
									<seriesExpression><![CDATA["Landed Stock (Days)"]]></seriesExpression>
									<categoryExpression><![CDATA[$F{month}]]></categoryExpression>
									<valueExpression><![CDATA[$F{landedStockDays}]]></valueExpression>
								</categorySeries>
								<categorySeries>
									<seriesExpression><![CDATA["Landed StockTarget (Days)"]]></seriesExpression>
									<categoryExpression><![CDATA[$F{month}]]></categoryExpression>
									<valueExpression><![CDATA[$F{landedStkDaysTarget}]]></valueExpression>
								</categorySeries>
							</categoryDataset>
							<linePlot>
								<plot>
									<seriesColor seriesOrder="0" color="#9A00FF"/>
									<seriesColor seriesOrder="1" color="#FF3333"/>
								</plot>
								<categoryAxisFormat>
									<axisFormat>
										<labelFont/>
										<tickLabelFont/>
									</axisFormat>
								</categoryAxisFormat>
								<valueAxisLabelExpression><![CDATA["DAYS"]]></valueAxisLabelExpression>
								<valueAxisFormat>
									<axisFormat>
										<labelFont>
											<font fontName="Arial" size="8" isBold="true"/>
										</labelFont>
										<tickLabelFont/>
									</axisFormat>
								</valueAxisFormat>
							</linePlot>
						</lineChart>
					</axis>
					<axis>
						<lineChart>
							<chart isShowLegend="true">
								<reportElement x="0" y="0" width="0" height="0" backcolor="#FFFFFF"/>
								<chartTitle color="#000000"/>
								<chartSubtitle color="#000000"/>
								<chartLegend textColor="#000000" backgroundColor="#FFFFFF" position="Top"/>
							</chart>
							<categoryDataset>
								<categorySeries>
									<seriesExpression><![CDATA["Landed Stock"]]></seriesExpression>
									<categoryExpression><![CDATA[$F{month}]]></categoryExpression>
									<valueExpression><![CDATA[$F{landedStock}]]></valueExpression>
								</categorySeries>
							</categoryDataset>
							<linePlot>
								<plot>
									<seriesColor seriesOrder="0" color="#40D5A7"/>
								</plot>
								<categoryAxisFormat>
									<axisFormat>
										<labelFont/>
										<tickLabelFont/>
									</axisFormat>
								</categoryAxisFormat>
								<valueAxisLabelExpression/>
								<valueAxisFormat>
									<axisFormat tickLabelColor="#FFFFFF" tickLabelMask="" axisLineColor="#FFFFFF">
										<labelFont>
											<font fontName="Arial" size="0"/>
										</labelFont>
										<tickLabelFont/>
									</axisFormat>
								</valueAxisFormat>
								<rangeAxisMinValueExpression><![CDATA[new Integer(0)]]></rangeAxisMinValueExpression>
								<rangeAxisMaxValueExpression><![CDATA[$P{range}]]></rangeAxisMaxValueExpression>
							</linePlot>
						</lineChart>
					</axis>
				</multiAxisPlot>
			</multiAxisChart>
		</band>
	</title>
	<pageHeader>
		<band splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band splitType="Stretch"/>
	</columnHeader>
	<detail>
		<band splitType="Stretch"/>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band splitType="Stretch"/>
	</summary>
</jasperReport>

plz somebody reply if there is any solution for this



Post Edited by chandan_raj2k at 08/11/2010 13:48
chandan_raj2k's picture
Joined: Aug 9 2010 - 9:26pm
Last seen: 3 years 8 months ago

3 Answers:

0
Most likely your data contains the value of 0 for the points that are displayed. If the value came out as NULL then it would not display the line chart data points where there is a null value.
uhurusurfa's picture
Joined: Oct 10 2006 - 3:25am
Last seen: 7 years 6 months ago
0

Hi,

 

Thanks for your reply. But since in the database these are primitive datatypes so I cannot allocate null to it.

 

Can we change the positions of the line chart and bar chart in any way so that the two columns gets displayed first and then the line chart will be displayed .

Please reply if the solution which is menttioned above is feasible and if any changes need to be done to the .jrxml file.

 

Thanks in advance.

 

Please refer the attached files for the same.

chandan_raj2k's picture
Joined: Aug 9 2010 - 9:26pm
Last seen: 3 years 8 months ago
0

Hi,

 

I don't quite understand what you need to achieve. What do you mean you want to reduce the gap? Can you use Paint or some image editor to show us what would the ideal chart look like?

Or are you simply trying to get rid of the line points which are on the zero line?

 

Thanks,
Teodor

 

teodord's picture
2817
Joined: Jun 30 2006 - 9:00am
Last seen: 1 month 1 hour ago
Feedback