Tibbers
Tibbers

Reputation: 131

NumberAxis labelname (NOT tick labels) size and font

OK! So, I have a big chart that incorporates several elements from the dual axis example

final NumberAxis domainAxis = new NumberAxis("lulu");

// add the axis to the plot, map some sets, and a renderer

Now my problem is that the Y-Axis title's size and font have been modified and this appears correctly on the principal Y-Axis. In the second one (the problematic "lulu"), I get a custom font and size. Obviously, the two don't match and I need to change the font and size of the secondary NumberAxis title label to correspond to the original.

Is there any way to change the custom font and size I get for the title label other than subclassing NumberAxis and plugin in my own font and size? It would surprise me if the developers of JFreechart haven't thought of this, especially, considering the Dual Axis example!

Any ideas/suggestions/workarounds are more than welcome!

Cheers,

Tibi

P.S. I would have expected that the properties for the Y-Axis title (in the XYplot) to be applied to ALL existing axes and not just the first one...

Upvotes: 0

Views: 727

Answers (1)

luukes
luukes

Reputation: 1550

This sets the font of the first axis to the second axis:

plot.getRangeAxis(1).setLabelFont( plot.getRangeAxis(0).getLabelFont() )

Upvotes: 2

Related Questions