X-Axis gets too crowded as there are more labels on X-Axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
sakaray_c
Posts: 31
Joined: Mon Dec 22, 2003 11:35 am

X-Axis gets too crowded as there are more labels on X-Axis

Post by sakaray_c » Sat Jan 31, 2004 11:30 am

Hi,

For Stack Chart, X-Axis gets too crowded. As I have more labels on X-Axis it gets crowded. (i.e., labels overlap with one over other). Is there any other option to avoid this ?

Thanks and Regards,
sakaray_c

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 » Mon Feb 02, 2004 4:49 pm

Can you post a sample of your chart?
David Gilbert
JFreeChart Project Leader

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

sakaray_c
Posts: 31
Joined: Mon Dec 22, 2003 11:35 am

X-Axis gets too crowded as there are more labels on X-Axis

Post by sakaray_c » Tue Feb 03, 2004 6:36 am

Hi,

I am not able to post an image.

I am giving detail information abt my problem.

In Stack Chart X-Axis Labels are very lengthy (like United States Of America, United Kingdom etc). So the labels overlap one over the other.
Is there a way to set these labels with some orientation i.e, can we set the labels with some slope (with some angle) so that the labels doesn't overlap.

Thanks and Regards,
sakaray_c

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 » Tue Feb 03, 2004 10:19 am

If you are using 0.9.16, you can try this:

Code: Select all

CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
David Gilbert
JFreeChart Project Leader

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

sakaray_c
Posts: 31
Joined: Mon Dec 22, 2003 11:35 am

Post by sakaray_c » Tue Feb 03, 2004 12:05 pm

Thanks Dave,

It is working fine now.

Earlier i was using 0.9.15 version.

Thanks and Regards,
sakaray_c

laxais

Post by laxais » Tue Feb 03, 2004 4:15 pm

Hi David,

How do I get the same results with 0.9.9 version?

thanks

phamdinhnguyen
Posts: 22
Joined: Thu Jan 29, 2004 8:28 pm

X-Axis gets too crowded ...

Post by phamdinhnguyen » Mon Mar 01, 2004 8:07 pm

I got the same problem of "X-Axis gets too crowded" with a different flavor: My chart has hundreds of x-values, and though I set them with "Axis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_90)", hundreds of category labels become a single long contingous black box.

I've scouted many posts concerning this issue, no luck :(
Ideally, we want to specify that category labels (text) to appear every configurable number of x-values, i.e. says one label at each ten values.

Some solutions must be out there?

Locked