Domain Axis Tick Marks

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

Domain Axis Tick Marks

Post by Iain Crawford » Thu Aug 08, 2002 1:07 am

I have tried setting ticks marks visible on the domain axis for Different types of Vertical Bar charts.

(Cluster Bars, Stacked Bars, Standard Vertical)

Yet unfortunatly the the tick marks don't seem to appear.

Is there any straightforward way I can implement this feature for those graph types?

David Gilbert

Re: Domain Axis Tick Marks

Post by David Gilbert » Thu Aug 08, 2002 7:09 am

Hi Iain,

You'll need to add something into the draw(...) method of the HorizontalCategoryAxis class (and something similar for VerticalCategoryAxis), since ticks have never been available for category axes. There should probably be an option to draw the ticks in the middle of the category OR between the categories.

Regards,

DG.

Iain Crawford

Re: Domain Axis Tick Marks

Post by Iain Crawford » Thu Aug 08, 2002 5:22 pm

Yeah I couldn't see a method that would tell me the Y and X axis positions for the middle of the category.

Tick give me and X and Y but that was for the start of the text to be displayed - I couldn't work it out from there?

David Gilbert

Re: Domain Axis Tick Marks

Post by David Gilbert » Thu Aug 08, 2002 5:58 pm

For some reason I can't think of now I originally gave the CategoryPlot class responsibility for positioning categories...so you can get the center of the category using the getCategoryCoordinate(...) method. It will be an x-value for VerticalCategoryPlot and a y-value for HorizontalCategoryPlot.

The other coordinate you can get from the plotArea in the draw(...) method of the CategoryAxis classes...it is the area defined by the axes, so the edge of this area is where you need to draw the ticks.

Regards,

DG.

Locked