JFreeChart多饼状图的子标题中文乱码

img


下方的子标题总是中文乱码,我用的是

MultiplePiePlot plot = (MultiplePiePlot) chart.getPlot();
        //设置多饼图的背景颜色为白色。
        plot.setBackgroundPaint(Color.white);
        //设置多饼图的外边框(outline)线条粗细为 1.0 像素。
        plot.setOutlineStroke(new BasicStroke(1.0f));
        //获取多饼图的子图对象。
        JFreeChart subchart = plot.getPieChart();
        //将子图对象转换为 PiePlot 类型,以便对饼图进行设置。
        PiePlot p = (PiePlot) subchart.getPlot();
        //设置饼图的背景颜色为空,即透明。
        p.setBackgroundPaint(null);
        //设置饼图的外边框线条为空,即不显示外边框。
        p.setOutlineStroke(null);
        //设置饼图标签生成器,用于生成标签文本。
        // 示例中的标签格式为 "{0} ({2})",其中 {0} 表示饼图部分名称,{1}显示数值{2} 表示百分比。
        p.setLabelGenerator(new StandardPieSectionLabelGenerator(
                "{0} ({1} - {2})", NumberFormat.getNumberInstance(), NumberFormat.getPercentInstance()
        ));
//        设置饼图标签的最大宽度,以百分比值表示。
//        示例中设置为 0.35,表示标签的宽度不超过饼图半径的 35%。
        p.setMaximumLabelWidth(0.40);
//        设置饼图标签的字体样式。普通样式(Font.PLAIN)
        p.setLabelFont(font);

//        设置饼图中心区域的间隙大小,以百分比值表示。
//        示例中设置为 0.30,表示间隙占饼图半径的 30%。
        p.setInteriorGap(0.20);