JFreeChartの円グラフ修正方法


最近、元のWebプロジェクトを変更しました.プロジェクトにはJFreeChartが使われています.JFreeChartで餅図を描く色を変更し、keyが一定の色に対応することを望んでいます.
例えば、ABCDを選ぶ4つの答えの割合は、それぞれ10%、30%、20%、40%です.希望円グラフのAの色はred、Bの色はgreen、Cの色はyellow、Dの色はblueです.
次のことができます.
1.datasetを用意しておくと、pieChartには必要なdatasetフォーマットがあります.
2.pieChartを作成する方法を書きます.
public static JFreeChart createPieChart(DefaultPieDataset dataset, String mytitle) {
			JFreeChart chart = ChartFactory.createPieChart(mytitle,dataset,true, true, false);
			PiePlot plot = (PiePlot) chart.getPlot();
			plot.setSectionOutlinesVisible(false);
			plot.setNoDataMessage("         !");
			plot.setSectionPaint("A", Color.RED);
			plot.setSectionPaint("B", Color.GREEN);
			plot.setSectionPaint("C", Color.YELLOW);
			plot.setSectionPaint("D", Color.BLUE);
			//      ,      key           

//	        PiePlot plot = (PiePlot) chart.getPlot();
	        plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12));
	        plot.setCircular(false);
	        plot.setLabelGap(0.02);
//do more things here
	        return chart;
}

気づいたsetSectionPaint("A", Color.RED);この方法ですね.この方法は色を設定するキー文です.この方法がない場合、JFreeChartは作成中にデフォルトの色を呼び出し、各領域の色設定を行います.
はっきり言ったかどうかはわかりませんが・・・