ValueAxis inside data area.

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
CyberMaarten
Posts: 6
Joined: Sun Oct 21, 2012 5:27 pm
antibot: No, of course not.

ValueAxis inside data area.

Post by CyberMaarten » Mon Dec 03, 2012 7:57 pm

If I understand correctly, axes are drawn on the edge of the data area. Is there an easy way to draw them inside the area?

Like this:
Image

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: ValueAxis inside data area.

Post by matinh » Tue Dec 04, 2012 12:02 pm

Hi!

To my knowledge there is currently no support for drawing axis inside the XYPlot (PolarPlot has it, but that's probably not what you want).
But you have the possibility to draw the axis on the plot's edges and add zero baselines. What you do not get this way is moving the labels and ticks inside the data area.

However, your request seems legitimately to me and I remember having read similar requests before. Search this forum and the feature request tracker to see if somebody already did some work on this. If you can't find anything please create a new feature request and post the URL back here.

hth,
- martin

CyberMaarten
Posts: 6
Joined: Sun Oct 21, 2012 5:27 pm
antibot: No, of course not.

Re: ValueAxis inside data area.

Post by CyberMaarten » Tue Dec 04, 2012 7:48 pm

Hi Martin,

Thx for your reply.
But you have the possibility to draw the axis on the plot's edges and add zero baselines.
Do you mean to give the x and y gridlines with value 0 a different stroke (like thicker or a different color), and keep the value labels on the edge? Because that's actually all I want. It probably even looks better not to have the labels and ticks inside the data area, now I think about it :-)

If so, what is the way to do it?

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: ValueAxis inside data area.

Post by matinh » Thu Dec 06, 2012 9:47 am

Yes, that's what I mean. And you can use drawZeroDomainBaseline() and drawZeroRangeBaseline() and related methods for setting the paint.

hth,
- martin

CyberMaarten
Posts: 6
Joined: Sun Oct 21, 2012 5:27 pm
antibot: No, of course not.

Re: ValueAxis inside data area.

Post by CyberMaarten » Thu Dec 06, 2012 4:38 pm

Works like a charm! Thanks!

Locked