How to explicitly set the plot area inside a chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
alsw-2000
Posts: 16
Joined: Thu May 22, 2003 12:53 pm

How to explicitly set the plot area inside a chart

Post by alsw-2000 » Thu May 29, 2003 6:57 am

Dear all,

Is there any API that can set the plot's height or width of a chart?
or the length of the x/y-axis of a chart?

Cheers,
alsw-2000

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu May 29, 2003 4:31 pm

No. JFreeChart allocates space for the chart title(s), legend, and the plot's axes...whatever is left after that gets used for the data.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

daveod

Post by daveod » Mon Jun 02, 2003 4:10 pm

David,
I would like to see this discussed farther. I set up the ratio (dataAreaRatio) appoach in the ContourPlot in order to create plots with the correct aspect ratio (i.e. so that map contours would look correct when doing lat/lon type plotting). This approach could easily be applied to the XYPlot type. Another benefit to defining the plot's aspect ratio is that plots sent to the printer will have the same aspect ratio as shown on the screen. I not sure how this translates to other plot types (i.e. combop plots).
TakeCare,
DaveOD

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Jun 02, 2003 5:07 pm

Am I right in saying that your aspect ratio code will reduce the data area (either in width or height) to preserve the unit relationship between the two axes? That's safe, because now the axes, etc. have more space than they actually require, so you'll just see some whitespace at the left and right or top and bottom of your chart. What I need to avoid is the situation where the data area is made any larger than the space that is available after the titles, legend and axes have been drawn.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

daveod

Post by daveod » Mon Jun 02, 2003 8:04 pm

David,
Yes, the data area is reduced after first determining the available data area using your methods (i.e accounting for titles, axis, etc).
TakeCare,
DaveOD

Locked