HorizontalDateAxis.java:510 in jfreechart0.9.2

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Achilleus Mantzios

HorizontalDateAxis.java:510 in jfreechart0.9.2

Post by Achilleus Mantzios » Tue Sep 03, 2002 1:52 pm

The code should respect a null value for HorizontalDateAxis "label" field.

For instance when some one creates a gantt chart as

chart = ChartFactory.createGanttChart(null,null,null,Data,true);

then we get an exception:

java.lang.NullPointerException:
at java.awt.Font.getLineMetrics(Font.java:1353)
at com.jrefinery.chart.HorizontalDateAxis.reserveAxisArea(HorizontalDateAxis.java:510)
at com.jrefinery.chart.HorizontalCategoryPlot.draw(HorizontalCategoryPlot.java:298)
at com.jrefinery.chart.JFreeChart.draw(JFreeChart.java:582)
at com.jrefinery.chart.JFreeChart.draw(JFreeChart.java:461)
at ganttie.draw(ganttie.java:215)
at ganttie.doGet(ganttie.java:196)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

etc...

Under FreeBSD with native jdk13 (green threads, classic vm) it just
produces the exception.
Under the same system with linux-jdk13 the JVM (jboss) dies.

David Gilbert

Re: HorizontalDateAxis.java:510 in jfreechart0.9.2

Post by David Gilbert » Tue Sep 03, 2002 3:59 pm

Hi Achilleus,

I made a change just before releasing 0.9.3 on SourceForge...can you let me know if it solves the problem?

Regards,

DG

Achilleus Mantzios

Re: HorizontalDateAxis.java:510 in jfreechart0.9.2

Post by Achilleus Mantzios » Wed Sep 04, 2002 7:47 am

I am afraid, i dont have time at the moment.
But you can simply call the code i posted and try it out.
(IntervalCategoryDataset is populated by the code in GanttDemo).

Locked