我是JFreeChart的新手。我正在JFreeChart中创建一个自定义的环形图表。我没有得到预期的输出。
private static JFreeChart createChart(PieDataset dataset) {
CustomRingPlot plot = new CustomRingPlot(dataset);
JFreeChart chart = new JFreeChart("Custom Ring Chart",
JFreeChart.DEFAULT_TITLE_FONT, plot, false);
plot.setBackgroundPaint(null);
plot.setOutlineVisible(false);
plot.setLabelGenerator(null);
plot.setSectionPaint("A", Color.ORANGE);
plot.setSectionPaint("B", new Color(100, 100, 100));
plot.setSectionDepth(0.50);
plot.setSectionOutlinesVisible(false);
plot.setShadowPaint(null);
plot.setSeparatorsVisible(false);
plot.setExplodePercent("A", 0.05);
plot.setExplodePercent("B", 0.05);
plot.setAutoPopulateSectionOutlinePaint(true);
plot.setSimpleLabels(true);
return chart;
}
预期产出:
实际输出: