Guest User

Untitled

a guest
Sep 14th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. dataset Draw Chart with JFreeChart and MySQL DB [closed]
  2. for (int i =0 ; i<typesPannes.length ; i++)
  3. {
  4. ResultSet res = st.executeQuery(req+" and typeDerang = '"+typesPannes[i]+"'");
  5. System.out.println(req+" and typeDerang = '"+typesPannes[i]+"'");
  6. int count=0;
  7. while (res.next()) { count++ ; }
  8. System.out.println(count) ;
  9. dataset.setValue(count, " " , typesPannes[i]);
  10. }
  11. JFreeChart chart = ChartFactory.createBarChart ("BarChart using JFreeChart","row", "col", dataset,
  12. PlotOrientation.VERTICAL, false,true, false);
  13. chart.setBackgroundPaint(Color.yellow);
  14. chart.getTitle().setPaint(Color.blue);
  15. CategoryPlot p = chart.getCategoryPlot();
  16. p.setRangeGridlinePaint(Color.red);
  17. ChartPanel ch1=new ChartPanel(chart);
  18. panel.add(ch1);
  19.  
  20. dataset.setValue(count, " " , typesPannes[i]);
  21.  
  22. dataset.setValue(count, typesPannes[i], "");
Add Comment
Please, Sign In to add comment