Modifying the title

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

Modifying the title

Post by Robert » Wed Jun 12, 2002 9:49 pm

Question: Is it possible to not specify a title at all and free up some of that space for the plots?

David Gilbert

Re: Modifying the title

Post by David Gilbert » Thu Jun 13, 2002 10:00 am

Hi Robert,

You should be able to do this:

myChart.setTitles(null);

Regards,

DG.

Robert

Re: Modifying the title

Post by Robert » Thu Jun 13, 2002 3:30 pm

Thanks DG.

Robert

Re: Modifying the title

Post by Robert » Thu Jun 13, 2002 3:51 pm

DG,

When I try to do this, I get a null pointer exception.

Exception occurred during event dispatching:
java.lang.NullPointerException
at com.jrefinery.chart.JFreeChart.draw(Unknown Source)
at com.jrefinery.chart.JFreeChartPanel.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(JComponent.java:687)
at javax.swing.JComponent.paintChildren(JComponent.java:498)

David Gilbert

Re: Modifying the title

Post by David Gilbert » Thu Jun 13, 2002 4:36 pm

You are right, sorry. It might be safer to set the title list to an empty list:

myChart.setTitles(new ArrayList());

At some point I will clean up the title code.

Regards,

DG.

Locked