Search code examples
jfreechart

JFreeChart change text color


I have recently implemented a JFreeChart library in my program, but I struggle to change some of the colors of the text, so I can use it in my dark theme. The screenshot below highlights the labels I was not able to figure out how to change the color of.

I am using java swing library with the latest version of JFreeChart and JCommon

If there is any way of changing those colors to some brighter colors, I would be really glad.

Thanks everybody for their answers, I really appreciate any kind of help with this problem. This is the image showing which parts of the chart I want to change the color of the text.


Solution

  • Try setTickLabelPaint() on the Axis that you want.

    See all Changing color of labels in JFreeChart.