How do I deactivate labels/units on the x-axis?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
mst1978
Posts: 8
Joined: Wed Jul 19, 2006 3:35 pm

How do I deactivate labels/units on the x-axis?

Post by mst1978 » Wed Jul 19, 2006 3:40 pm

Hi,

I have a simple 2D bar chart:
y-axis: profit rate
x-axis: time (dates: 08/2001, 09/2005...07/2006)

I just want to deactivate the lables/units at the x-axis because there are so many entries and it looks horrible.
I don't need them because I can write the range "from: mm/yyyy to: mm/yyyy" in a table next to the graph.

Could somebody tell me how to do this?

Thanks!!! :)

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 » Fri Jul 21, 2006 3:40 pm

If you used an XYBarChart and a DateAxis, the labels would adjust automatically.

If you prefer to stick with the CategoryPlot, you can do this:

Code: Select all

CategoryPlot plot = (CategoryPlot) chart.getPlot();
CategoryAxis axis = plot.getDomainAxis();
axis.setTickLabelsVisible(false);
David Gilbert
JFreeChart Project Leader

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

Locked