Tick label alignment on Horizontal DateAxis

A free public discussion forum for the JFreeChart class library.

Tick label alignment on Horizontal DateAxis

Postby sporak » Mon Sep 10, 2012 12:22 pm

Hello,
I'm using jFreeChart 1.0.14.
I have graph with horizonatal date axis. And I'm trying to center tick labels so that they would be within two subsequent ticks.

JFreeChart aligns tick labels in common case this way:

Code: Select all
----+------------+------------+----
   Mon          Tue          Wed

Image

but I'd like to align tick labels this way:

Code: Select all
----+------------+------------+------------+----
         Mon          Tue          Wed

Image

(The tick labels are aligned by hand in graphic editor by editing the original image. It's not output of jFreeChart library.)

Is there any way, how to do it thru API of DateAxis ?
Any help is appreciated... :)

Thanks a lot for any help or idea.
Honza (sporak)
sporak
 
Posts: 2
Joined: Mon Sep 10, 2012 11:51 am

Re: Tick label alignment on Horizontal DateAxis

Postby david.gilbert » Tue Sep 11, 2012 8:20 pm

With DateAxis, you'd have to modify the label rendering code (it's not an API option). Another thing to try is PeriodAxis, which does labeling in a similar way to what you want (but may do other things that you don't want...but try it).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited
david.gilbert
JFreeChart Project Leader
 
Posts: 11282
Joined: Fri Mar 14, 2003 10:29 am

Re: Tick label alignment on Horizontal DateAxis

Postby John Matthews » Tue Oct 16, 2012 2:52 pm

Cross-posted here.
John Matthews
 
Posts: 196
Joined: Wed Sep 12, 2007 3:18 pm


Return to JFreeChart - General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Yahoo [Bot] and 10 guests