Package sn.unitech.stock.modal

Examples of sn.unitech.stock.modal.DataForGraph


  }
 
 
 
  public DataForGraph getDataForGraphVariation() {
  DataForGraph dataForGraph=new DataForGraph();
  DefaultCategoryDataset  categDataset=new DefaultCategoryDataset();
  Double qte;
  categDataset.clear();   
  Map<Integer,Date> abcisses=this.getAbcisses();
  for(int i=1;(abcisses!=null)&&(i<abcisses.size());i++){
  qte=this.getQtes(abcisses.get(i-1),abcisses.get(i));         
   categDataset.addValue(qte,"series1",format.format(abcisses.get(i)));     
  }
  dataForGraph.setCurrentDataset(categDataset);
  dataForGraph.setTitre(this.cproperties.libelleProduit);
  dataForGraph.setHeight(250);
  dataForGraph.setWidth(500);
  dataForGraph.setType(ToolsBean.LINE_TYPE)
  return (this.dataForGraphVariation=dataForGraph);
  }
View Full Code Here


  }
  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();}
    }
View Full Code Here

TOP

Related Classes of sn.unitech.stock.modal.DataForGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.