Skip to content
Advertisement

Change the font size of the y-axis and x-axis values

In the following code, I want to reduce the font size of the y-axis and x-axis values.

enter image description here

I searched and found these code:

suppose you want to reduce the font size of number axis use the following code:

JavaScript

suppose you want to reduce the font size of CategoryAxis use the following code:

JavaScript

but unfortunately, the size of the axes did not decrease. Did I do something wrong?

this sample code:

JavaScript

Advertisement

Answer

This is a bug, reported in issue #98: setTickLabelFont is not respected for LogAxis if setNumberFormatOverride is used. It is fixed in branch v1.5.x. You can omit the override, use the workaround in the bug report, or build jfreechart-1.5.4-SNAPSHOT.jar, illustrated, like this.

image

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement