Skip to content

xyBar: The item label is not displayed in the PDF document when using JFreeChart versions 1.5.4, 1.5.5 and 1.5.6. #534

@AndrewZyablov-tech

Description

@AndrewZyablov-tech

springBootVersion=3.5.3
jasperReportsVersion=7.0.3
jFreeChartVersion=1.5.6

After upgrading to the new version of JFreeChart =1.5.6, item labels disappeared.
Image

The examine showed that when using JFreeChart versions from 1.5.0 to 1.5.3, the item labels are displayed correctly.
Image
And when using versions of JFreeChart from 1.5.4 to 1.5.6, item labels disappeared.

!-- Created with Jaspersoft Studio version 7.0.1.final using JasperReports Library version 7.0.1-573496633c2b4074e32f433154b543003f7d2498 --
`

<element kind="chart" chartType="xyBar" uuid="48f3c001-176d-4047-b1d8-d704aa73d909" x="1" y="0" width="601" height="132" showLegend="false" evaluationTime="Report" linkType="None" linkTarget="Self" titleColor="#000000" titlePosition="Top">
	<titleFont fontSize="11.0"/>
	<legendFont/>
	<dataset kind="xy">
		<series>
			<seriesExpression><![CDATA["SERIES 1"]]></seriesExpression>
			<labelExpression><![CDATA["1"]]></labelExpression>
			<yvalueExpression><![CDATA[50]]></yvalueExpression>
			<xvalueExpression><![CDATA[1]]></xvalueExpression>
		</series>
		<series>
			<seriesExpression><![CDATA["SERIES 2"]]></seriesExpression>
			<labelExpression><![CDATA["2"]]></labelExpression>
			<autoSort>true</autoSort>
			<yvalueExpression><![CDATA[75]]></yvalueExpression>
			<xvalueExpression><![CDATA[2]]></xvalueExpression>
		</series>
		<series>
			<seriesExpression><![CDATA["SERIES 3"]]></seriesExpression>
			<labelExpression><![CDATA["3"]]></labelExpression>
			<autoSort>true</autoSort>
			<yvalueExpression><![CDATA[100]]></yvalueExpression>
			<xvalueExpression><![CDATA[2]]></xvalueExpression>
		</series>
	</dataset>
	<plot categoryAxisLabelColor="#000000" categoryAxisTickLabelColor="#000000" categoryAxisTickLabelMask="" categoryAxisVerticalTickLabels="false" categoryAxisLineColor="#FFFFFF" valueAxisLabelColor="#000000" valueAxisTickLabelColor="#000000" valueAxisVerticalTickLabels="false" valueAxisLineColor="#FFFFFF" showTickMarks="false" showTickLabels="false" showLabels="true">
		<categoryAxisLabelFont fontSize="10.0"/>
		<categoryAxisTickLabelFont fontSize="10.0"/>
		<itemLabel color="#000000" backgroundColor="#FFFFFF">
			<font fontSize="10.0" strikeThrough="false" italic="false" bold="false" underline="false"/>
		</itemLabel>
		<seriesColor order="0" color="#FFFFFF"/>
		<seriesColor order="1" color="#C0F9E9"/>
		<seriesColor order="2" color="#3BE9B9"/>
	</plot>
</element>
`

I examined the XYBarRenderer object, which returns JasperReports in two cases: JFreeChartVersion=1.5.3, where the item labels are displayed correctly:

Image Image

and JFreeChartVersion=1.5.6, where they are missing:

Image Image

At first glance, both versions have everything you need to display item labels. However, in the first case, the output is a correct PDF document, and in the second - without labels. Obviously, the XYBarRenderer objects are different for these versions. I can't figure out what is the reason for what is happening. I would like to know if I can fix this problem on my own.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions