Tick Marks - mark crosses axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Stewart Nunn

Tick Marks - mark crosses axis

Post by Stewart Nunn » Thu Oct 24, 2002 7:30 pm

I have CombinedXYPlot that displays tick marks on the the x and y axes. The tick marks straddle the axis '----+----+---'.
Is there a way to set the tick marks so they draw from the axis outline inward or outward?
Thanks in advance,
Stewart Nunn

Dave Gilbert

Re: Tick Marks - mark crosses axis

Post by Dave Gilbert » Fri Oct 25, 2002 9:28 am

Hi Stewart,

It's actually hard-coded at present. I keep meaning to add an option for 'inside' ticks, 'outside' ticks and 'regular' ticks, but I haven't done it yet.

You'll see the following code in the draw method of most of the axis classes:

if (tickMarksVisible) {
g2.setStroke(getTickMarkStroke());
g2.setPaint(getTickMarkPaint());
Line2D mark = new Line2D.Float(xx, maxY - 2, xx, maxY + 2);
g2.draw(mark);
}

It is the -2 and the +2 that need changing.

Regards,

DG.

Locked