How can I change the CategoryLabel into a small size font?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
iceox
Posts: 5
Joined: Fri Apr 08, 2005 4:30 pm

How can I change the CategoryLabel into a small size font?

Post by iceox » Tue Jun 21, 2005 4:02 pm

Image

I am currently using jfreechart-1.0.0-rc1.jar, and I am able to generate the Bar chart, changing font size for doman & range axis, and able to do the legendtitle size.

But for some reason, i wasnt able to find any help on this part of Legend issue, or maybe i dont know where to look for. As you see from my inclued image, my Color1 - Color4 is listed in vertical, I would like this set to be showing in horizontal.

I wonder if there is a way to customize that, and also if i want this block to move to top, how should i do it? which class and which method should i look into or call?

Thanks alot
ice
Last edited by iceox on Wed Jun 22, 2005 12:51 pm, edited 4 times in total.

iceox
Posts: 5
Joined: Fri Apr 08, 2005 4:30 pm

Post by iceox » Tue Jun 21, 2005 7:18 pm

I am able to fix the problem of Color1-Color4 into 1 single line now. In my DB retrive, i had some extra space after Color1, so after the trim, i was able to squeeze all them legend into 1 line by default.


But I still cannot make the font of those Category Lable on DomainAxis, like Dates "05/172004 - 06/07/2004" into some smaller font size.

Can anyone please help?

I have read the 0.9 verison of Developer Guide, but i couldnt find any session there would help me this issue.

Thanks again!
ice

kianfatt1982

I also have the similar problem

Post by kianfatt1982 » Fri Sep 30, 2005 3:58 am

But I have been told to solve the probelm using the below code snippet

Code: Select all

Font ft = new Font(null,Font.PLAIN, 1) ; 
objCategoryAxis.setLabelFont(ft);
objCategoryAxis.setTickLabelFont(ft);
objCategoryAxis.setMaximumCategoryLabelWidthRatio(1);
but still cannot, cause I need really really small fonts, but the Font class constructor only accepts integer sizes, Where as the font size that I might need is like 0.00001 somehting like that cause the display aread from my graph is relatively very very small.


mailto: kianfatt198@gmail.com

ccapano
Posts: 12
Joined: Mon Sep 12, 2005 9:22 pm
Location: Frederick, Maryland
Contact:

Post by ccapano » Fri Sep 30, 2005 4:26 am

How did you get the x axis labels to be on an angle?

Locked