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.
Legend size is resizing piechart size
Re: Legend size is resizing piechart size
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.
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.
Re: Legend size is resizing piechart size
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?
That said. Is there anyway to get all the data from the legend so I properly display color and data on my own legend?