Hi
I am generating few charts and converting them to images. These charts are different representation for the same data. The different images generated has to have the same height, this means that the height of data area for different graphs has to be the same The need is to display all graphs side by side. Hence height has to be the same for the data area, and i have to align the domain axis of all the images. I am using setFixedDimension on the axis. I am able to almost get to the height i require. When there are legends the height of the range axis gets altered. So it possible to calculate the height / bounds that will be occupied to render the legend items? Is there any direct api? or a neat way to do it.
Thanks,
Vijay Venkataram
Caculate bounds occupied to render legends in a plot.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
The legend size isn't stored anywhere, but if you look through the drawTitle() method in the JFreeChart class you'll see how it is calculated by calling the arrange() method. You could call arrange() yourself to find out how big the legend is...
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

