// set the max width of each bar
BarRenderer renderer = (BarRenderer) plot.getRenderer();
renderer.setMaxBarWidth(0.10);
// print the chart image directly the the HTTP stream
OutputStream out = response.getOutputStream();
response.setContentType("image/jpeg");
try
{
ChartUtilities.writeChartAsJPEG(out, 1.0f, barChart, 400, 300);
}catch(IOException e){
logger.error("[getOpportunityPieData] Exception thrown.", e);
throw new ServletException(e);
}finally{
out.close();
}
// return null (don't forward anywhere, we've done the output already)
return(null);
} // end execute() method