Legend size is resizing piechart size

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

Legend size is resizing piechart size

Post by Bray Jones » Fri Jul 26, 2002 4:43 pm

I have a pie chart that may have 5-15 items in the legend. This will increase the legend size and thus decrease the actual pie size in the graph.

Is there any way to 'unlink' the legend from affecting the size of the actual piechart? I want the actual pie chart to remain a certain size no matter how many elements are in the legend. If the image as whole has to grow to accomadate the legend, that is ok.

Thanks in advance.

David Gilbert

Re: Legend size is resizing piechart size

Post by David Gilbert » Mon Jul 29, 2002 10:01 am

Hi Bray,

Unfortunately there isn't an easy way to do this. When I first wrote JFreeChart, I decided that the charts should draw themselves within the available space (whatever size that happens to be), rather than working out how much space they needed then resizing the container. Most of the time, this works well, but not in every situation.

Perhaps you can set the legend to null, then display your own legend outside of the chart...

Regards,

DG.

Bray Jones

Re: Legend size is resizing piechart size

Post by Bray Jones » Mon Jul 29, 2002 12:50 pm

Thanks DG for the reply.

That said. Is there anyway to get all the data from the legend so I properly display color and data on my own legend?

Locked