Regression when upgrading JFreeChart to 1.5.0

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
jucui
Posts: 1
Joined: Thu Oct 17, 2019 8:44 pm
antibot: No, of course not.

Regression when upgrading JFreeChart to 1.5.0

Post by jucui » Thu Oct 17, 2019 8:50 pm

I am using JFreeChart to generate a benchmark report, but an exception is thrown when generating a buffered image after upgrading from version 1.0.19 to 1.5.0. The API worked fine before upgrading the version. To reproduce the bug, download this folder and run the commands found in README.adoc. From debugging, the exception seems to be caused by the lengthToJava2D() method returning NaN, resulting in a division by zero. The stack trace is as follows:

Code: Select all

Caused by: java.lang.IllegalArgumentException: Must be finite.
	at org.jfree.chart.axis.NumberTickUnitSource.getCeilingTickUnit(NumberTickUnitSource.java:114) ~[jfreechart-1.5.0.jar!/:na]
	at org.jfree.chart.axis.NumberAxis.selectVerticalAutoTickUnit(NumberAxis.java:896) ~[jfreechart-1.5.0.jar!/:na]
	at org.jfree.chart.axis.NumberAxis.selectAutoTickUnit(NumberAxis.java:828) ~[jfreechart-1.5.0.jar!/:na]
	at org.jfree.chart.axis.NumberAxis.refreshTicksVertical(NumberAxis.java:1049) ~[jfreechart-1.5.0.jar!/:na]
	at org.jfree.chart.axis.NumberAxis.refreshTicks(NumberAxis.java:929) ~[jfreechart-1.5.0.jar!/:na]
	at org.jfree.chart.axis.ValueAxis.reserveSpace(ValueAxis.java:806) ~[jfreechart-1.5.0.jar!/:na]
	at org.jfree.chart.plot.CategoryPlot.calculateRangeAxisSpace(CategoryPlot.java:3432) ~[jfreechart-1.5.0.jar!/:na]
	at org.jfree.chart.plot.CategoryPlot.calculateAxisSpace(CategoryPlot.java:3466) ~[jfreechart-1.5.0.jar!/:na]
	at org.jfree.chart.plot.CategoryPlot.draw(CategoryPlot.java:3512) ~[jfreechart-1.5.0.jar!/:na]
	at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1286) ~[jfreechart-1.5.0.jar!/:na]
	at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1453) ~[jfreechart-1.5.0.jar!/:na]
	at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1434) ~[jfreechart-1.5.0.jar!/:na]
	at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1419) ~[jfreechart-1.5.0.jar!/:na]
Any advice is appreciated. Thanks in advance!

Post Reply