http://www.decisionsdecisions.net/examp ... charts.png
I am trying to get the pie to fill the available space in the plot [the plot has the yellow background] however cannot seem to get the chart to expand to the left and right edges.
I have been unable to get this to work with either PieChart or RingChart.
Any ideas?
Thanks.
Code: Select all
private JFreeChart buildPieChart(Portfolio portfolio)
{
PortfolioPieDataset ppd = new PortfolioPieDataset(portfolio);
//JFreeChart chart = ChartFactory.createPieChart("", ppd, false, false, false);
//PiePlot plot = (PiePlot)chart.getPlot();
JFreeChart chart = ChartFactory.createRingChart("", ppd, false, false, false);
RingPlot plot = (RingPlot)chart.getPlot();
plot.setLabelGenerator(null);
plot.setSectionDepth(0.5);
plot.setBackgroundPaint(Color.yellow);
plot.setInteriorGap(0);
plot.setOutlinePaint(Color.red);
//plot.setCircular(true);
return chart;
}