如何增加显示颜色的图例键的大小。字体大小由chart.getLegend().setItemFont(new Font("SansSerif", Font.PLAIN, 12));
但我无法找到如何管理颜色键大小的方法。我的代码是
plot.setInsets(new RectangleInsets(0.0, 0.0, 0.0,0.0));
plot.setToolTipGenerator(new StandardPieToolTipGenerator(
StandardPieToolTipGenerator.DEFAULT_SECTION_LABEL_FORMAT));
plot.setDirection(Rotation.CLOCKWISE);
List keys = dataset.getKeys();
int i=0;
for (Iterator it = keys.iterator(); it.hasNext();) {
Comparable key = (Comparable) it.next();
plot.setSectionPaint(key,requiredcol[i]);
//plot.setExplodePercent(key, 0.04);
i++;
}
// create a Ring Chart...
JFreeChart chart = new JFreeChart(chartTitle, JFreeChart.DEFAULT_TITLE_FONT, plot, showLegend);
chart.setPadding(new RectangleInsets(0,0,0,0));
chart.setBackgroundPaint(java.awt.Color.white);
if(showLegend){
chart.getLegend().setFrame(BlockBorder.NONE);
chart.getLegend().setPosition(RectangleEdge.RIGHT);
chart.getLegend().setItemFont(new Font("SansSerif", Font.PLAIN, 12));
}
//chart.removeLegend();
// save it to an image
try {
final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
final File file1 = new File(chartDirectory + File.separator + chartFileName.toString().trim());
ChartUtilities.saveChartAsPNG(file1, chart, width, height, info);
currentImageMap = ImageMapUtilities.getImageMap(chartFileName.toString(),info);
}
此外,我的密钥大小会被plot.setSectionOutlineStroke(new BasicStroke(3));
的少量反映..请帮忙!
[1]: http://i.stack.imgur.com/bDh4Z.png