I've been using jFreeChart for some time, and this past weekend I decided to change to version 0.9.4.
After making some necessary changes to my code (especially regarding HorizontalDateAxis) I was finally ready to run the new code. To my (unpleasant) surprise, my program didn't finish... it runned for a LOT of time (5 min) before it crashed with "out of memory". I traced the problem to one line of code:
chart.draw(g2, new Rectangle2D.Double(0, 0, r.width(), r.height()), null);
where g2 is
Graphics2D g2 = cb.createGraphics(r.width(), r.height());
So, to put it simple, this function (draw) is not returning anymore. The chart is a very simple TimeSeriesCollection, with just one BasicTimeSeries.
One of the changes I had to make that I wasn't sure it would work was:
from
((HorizontalDateAxis)timeAxis).setTickUnit(new DateUnit(java.util.Calendar.DAY_OF_MONTH, 5)); ((HorizontalDateAxis)timeAxis).getTickLabelFormatter().applyPattern("d");
to
((HorizontalDateAxis)timeAxis).setTickUnit(
new DateTickUnit(java.util.Calendar.DAY_OF_MONTH, 5,
new java.text.SimpleDateFormat("d"))
);
I don't know if that's the problem... could anyone give me a help? Until then, I'll have to use old versions...
