plot border

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jcamp
Posts: 36
Joined: Thu Apr 01, 2004 4:20 pm

plot border

Post by jcamp » Wed May 12, 2004 1:41 am

i have a chart with an associated plot. the plot has an area which houses the data points and it has an area which houses the x and y axes.

what class.method will give me the the width/height of the space occupied by the axes (either as a proportion or an actual value) ??

if anyone can get me close, i'll find it from there...

nicky
Posts: 44
Joined: Mon Apr 05, 2004 1:45 am
Location: Brisbane, Australia

Post by nicky » Wed May 12, 2004 5:52 am

I'm not sure what axis you are using, but for me I used valueAxis.getUpperBound() and valueAxis.getLowerBound() and they returned the axis positions.

Hope this helps.

Nicky

jcamp
Posts: 36
Joined: Thu Apr 01, 2004 4:20 pm

plot border

Post by jcamp » Wed May 12, 2004 2:08 pm

i also used that but those give the upper and lower 'values' of the axes. i'm after the 'size' of the rectangle which holds the axes...

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 » Wed May 12, 2004 3:09 pm

If you are displaying your chart in a ChartPanel, then this method returns a structure that contains information about the chart dimensions:

http://www.jfree.org/jfreechart/javadoc ... deringInfo()

If you are using some other method to display your chart, then you need to create a new ChartRenderingInfo object before drawing the chart, then pass this to the drawing method. For example, the saveChartAsPNG() method will accept such an object:

http://www.jfree.org/jfreechart/javadoc ... eringInfo)

When the method returns, the 'info' object is populated with the information you need.
David Gilbert
JFreeChart Project Leader

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

jcamp
Posts: 36
Joined: Thu Apr 01, 2004 4:20 pm

plot border

Post by jcamp » Wed May 12, 2004 5:14 pm

david,

U DA MAN !!

got just what i needed.

thanks much !!

jcamp
Posts: 36
Joined: Thu Apr 01, 2004 4:20 pm

plot border revisited

Post by jcamp » Thu Feb 24, 2005 4:12 pm

it's been quite a while since this thread ran its course.

now, i am using cewolf and was wondering if there now exists a way to get the ChartRenderingInfo object 'post chart creation' as opposed to when the chart is being created ???

Locked