PeriodAxis problem

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
fede
Posts: 20
Joined: Tue May 23, 2006 9:15 am

PeriodAxis problem

Post by fede » Tue Aug 29, 2006 1:22 pm

HI,
I have a strange problem usin PeriodAxis().Indeed, i'm not able o set the color of ticks labels of the axis.So i can't change My PeriodAxis color (only the axis line is corrctly setted).
Does someone knwo about this problem and how to work aroung?

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 Aug 29, 2006 1:59 pm

This is a bit messy, because the inherited methods for tick labels won't do anything. The PeriodAxis supports multiple "bands" of labels, which you configure by calling the setLabelInfo(PeriodAxisLabelInfo[]) method. The array contains one item for each band of labels, and one of the attributes of the PeriodAxisLabelInfo class is the labelPaint, which is the one you need to set.
David Gilbert
JFreeChart Project Leader

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

fede
Posts: 20
Joined: Tue May 23, 2006 9:15 am

Post by fede » Tue Aug 29, 2006 5:26 pm

Hi David!
I tried your suggestion and i have resolved the problem.
Thanks for your help!

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 Aug 29, 2006 5:39 pm

Great! I'm wondering about a sensible way to override the setTickLabelPaint() method (and related methods)...do you think they should just throw a "not supported" exception or should I map them to update the first PeriodAxisLabelInfo[] instance so that they do something useful? Doing nothing (which is what JFreeChart does now) isn't very helpful, as you've discovered...
David Gilbert
JFreeChart Project Leader

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

jwenting
Posts: 157
Joined: Sat Jul 15, 2006 7:46 am

Post by jwenting » Wed Aug 30, 2006 6:56 am

Maybe a sensible solution is to use as default the value set on the axis, unless another value is set in the labelInfo for that particular band.
That way an application could set a global value yet still have the flexibility to override this on a case by case basis for each band separately.

Locked