resizing of the chart panel

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

resizing of the chart panel

Post by Fabien D. » Wed Nov 29, 2000 9:31 am

Hi,
in the JFreeChartDemo we can see that reducing the window to a very small size give bad display of chart items. Do you have this in your todo list? What must be done if someone want to correct this bug ?

David Gilbert

RE: resizing of the chart panel

Post by David Gilbert » Thu Nov 30, 2000 1:54 pm

Hi Fabien,

Thanks for the feedback. It is an annoying problem...as usual, there are a couple of solutions:

(1) Simply prevent the JFreeChartPanel from getting small enough to cause a problem (which means enforcing a minimum size on the frame that contains the JFreeChartPanel). The exact size at which the "bad display" occurs depends on the contents of the chart, labels, etc. so the programmer (me, in the case of the demo) has to decide what the minimum size should be to avoid most of the problems.

(2) Change the code that draws the chart to recognise when there is insufficient space to draw the title, legend and/or plot. The code could either raise an exception, letting the caller handle it, or just draw something to indicate that the chart size is too small (a grey box?)

Let me know if you can think of another solution. I'll add the task to the "to-do" list.

Regards,

DG.

Locked