Problem in displaying the category label...?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
prabhurangan
Posts: 2
Joined: Thu Jul 17, 2008 5:52 am

Problem in displaying the category label...?

Post by prabhurangan » Thu Jul 17, 2008 5:59 am

Hi Members,

Good Morning.

Im having some problem in displaying the category labels. Im having

final String series1 = "Passed";
final String series2 = "Failed";
final String series3 = "Aborted";

// column keys...
final String category1 = "2008-07-09 08:45:23";
final String category2 = instance2;
final String category3 = instance3;

Here the category will come as the label name, as the size is big i can not show it fully and if i declare some position for it, it looks so odd, but i need it to show fully in 180 degree horizontally...

Currently im using this code:

Code: Select all

CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0));
Please help me in this to fix this...

Looking forward for your reply.....

Regards,
Prabhu.[/code]

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 » Thu Jul 17, 2008 9:53 pm

My first question is why are you using a date/time *value* as a category. Why not use a time series chart, then you can have a DateAxis which is specifically designed for displaying date/time values?
David Gilbert
JFreeChart Project Leader

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

prabhurangan
Posts: 2
Joined: Thu Jul 17, 2008 5:52 am

Hi david, this is my requirement.........

Post by prabhurangan » Fri Jul 18, 2008 5:29 am

Hi David,

I have gone through several post in this forum, and very glad that you have proven as Jfreechart guru by sharing your ideas with members.

As far in my post, this is our requirement to show it as Bar chart with date/time as category value..............

We can not change the requirement for the last moment....
Please help me in this how to place the Label value horizontally in 180 degree, now as it is center aligned, and if we give the category label position, it is not aligned properly......

Please help me in this David......

Looking forward for your reply.........


Regards,
Prabhu.

travis_cooper
Posts: 6
Joined: Thu Jul 17, 2008 3:57 pm
Location: Salt Lake City, Utah

Post by travis_cooper » Fri Jul 18, 2008 3:20 pm

When you're setting the category label position try using CategoryLabelPositions.UP_90 instead of CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)
Travis

dineshsingh1976
Posts: 2
Joined: Tue Aug 19, 2008 10:00 pm

Post by dineshsingh1976 » Tue Aug 19, 2008 11:14 pm

I have the similar problem and not able to display the y axes labels..

String series1 = "Min";
String series2 = "Average";
String series3 = "Max";

// column keys...
String category1 = "Category 1111111112312312312";
String category2 = "Category 2123123123122112121";
String category3 = "Category 3123123123123123121";
String category4 = "Category 4123123123123121212";
String category5 = "Category 512323123123121";
String category6 = "Category 6";
String category7 = "Category 7";

used the below as suggested by David
CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);


But it is not displaying the complete label.

Locked