}
public void setDataForGraphComparaison(DataForGraph dataForGraphComparaision) {
this.dataForGraphComparaison = dataForGraphComparaision;
}
public void generateChartMethod(java.io.OutputStream out, Object data) {
DataForGraph dataGraph=(DataForGraph)data;
JFreeChart chart;
if(dataGraph.getType().equals(ToolsBean.BAR_TYPE))
chart = ChartFactory.createBarChart3D(dataGraph.getTitre(),null,"",dataGraph.getCurrentDataset(),PlotOrientation.VERTICAL,true,true,false);
else chart = ChartFactory.createLineChart3D(dataGraph.getTitre(),null,"",dataGraph.getCurrentDataset(),PlotOrientation.VERTICAL,true,true,false);
BufferedImage buffImg = chart.createBufferedImage(
dataGraph.getWidth(), //width
dataGraph.getHeight(), //height
BufferedImage.TYPE_INT_RGB, //image type
null);
try {ImageIO.write(buffImg, "jpeg", out);}
catch (IOException e) {e.printStackTrace();}
}