When using jfreechart, I encountered the problem of Chinese garbled characters, and several methods for setting font provided on the Internet were unsuccessful.
PS: It can always be displayed correctly on my local machine, but once it is on the server (linux), it will not work. I use jfreechart to generate pictures and apply them in html.
The final solution was to set a custom font:
Font ft = Font.createFont(Font.TRUETYPE_FONT, new File("仿宋_GB2312.ttf"));
ft = ft.deriveFont(Font.PLAIN,16);