2 questions on time axis labels

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
tmtjond
Posts: 23
Joined: Thu Jul 24, 2008 3:21 am

2 questions on time axis labels

Post by tmtjond » Mon Jun 01, 2009 1:08 pm

I know that the date format of the labels can be controlled via timeAxis.setDateFormatOverride(tickDateFormatter);
However, it is a 'global' configuration, meaning that if there are 5 labels would be printed, all of them will be in that format.
Is it possible to inject with individual setting for each label?

Between, I found that if a segmented time line is set, say mon 9:00 to fri 17:00 (fri 17:01 - mon 8:59 are days off)
The 'segment end' label MAY overlap with following 'segment head' label.
Is it a possible bug or is there any margin option for the 'segment time line' case ?


Thanks.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: 2 questions on time axis labels

Post by david.gilbert » Mon Jun 01, 2009 1:38 pm

The segmented timeline labelling is not very clever, so this is most likely a bug / limitation. If you want to, you can subclass the axis and override the refreshTicks() method and write your own code to determine the tick marks that will be labelled.
David Gilbert
JFreeChart Project Leader

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

tmtjond
Posts: 23
Joined: Thu Jul 24, 2008 3:21 am

Re: 2 questions on time axis labels

Post by tmtjond » Mon Jun 01, 2009 4:57 pm

Thanks for your reply.

And concerning the following question:

I know that the date format of the labels can be controlled via timeAxis.setDateFormatOverride(tickDateFormatter);
However, it is a 'global' configuration, meaning that if there are 5 labels would be printed, all of them will be in that format.
Is it possible to inject with individual setting for each label?


I believe it is a limitation as well. Which method(s) should I override to overcome it?

Locked