Rafael Chaves
Rafael Chaves

Reputation: 13

Change axis label Color (JFreeChart)

Can anyone tell me how I can proceed to change the color of the axes' labels as circled below?

enter image description here

Upvotes: 1

Views: 241

Answers (1)

Catalina Island
Catalina Island

Reputation: 7126

You can use setTickLabelPaint() and setLabelPaint() like this:

Axis domain = plot.getDomainAxis();
domain.setTickLabelPaint(Color.blue);
domain.setLabelPaint(Color.blue);
Axis range = plot.getRangeAxis();
range.setTickLabelPaint(Color.red);
range.setLabelPaint(Color.red);

Upvotes: 1

Related Questions