}
chartRemote.setDataSource(dataSource);
Collection chartRawData = (Collection)chartRemote.getOpportunityPieData(individualId, listParameters);
// Add the raw data to a JFree dataset
DefaultPieDataset pieData = new DefaultPieDataset();
float totalForecast = 0.00f;
float totalActual = 0.00f;
Iterator iter = chartRawData.iterator();
while (iter.hasNext())
{
HashMap row = (HashMap)iter.next();
String stageName = (String)row.get("stageName");
Number count = (Number)row.get("count");
Number forecastAmount = (Number)row.get("forecastAmount");
Number actualAmount = (Number)row.get("actualAmount");
totalForecast += forecastAmount.floatValue();
totalActual += actualAmount.floatValue();
pieData.setValue(stageName + " (" + count.toString() + ")", forecastAmount);
}
// format the totals as US Currency
NumberFormat numFormatter = NumberFormat.getCurrencyInstance();
String totalForecastString = numFormatter.format(totalForecast);