Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dataset Draw Chart with JFreeChart and MySQL DB [closed]
- for (int i =0 ; i<typesPannes.length ; i++)
- {
- ResultSet res = st.executeQuery(req+" and typeDerang = '"+typesPannes[i]+"'");
- System.out.println(req+" and typeDerang = '"+typesPannes[i]+"'");
- int count=0;
- while (res.next()) { count++ ; }
- System.out.println(count) ;
- dataset.setValue(count, " " , typesPannes[i]);
- }
- JFreeChart chart = ChartFactory.createBarChart ("BarChart using JFreeChart","row", "col", dataset,
- PlotOrientation.VERTICAL, false,true, false);
- chart.setBackgroundPaint(Color.yellow);
- chart.getTitle().setPaint(Color.blue);
- CategoryPlot p = chart.getCategoryPlot();
- p.setRangeGridlinePaint(Color.red);
- ChartPanel ch1=new ChartPanel(chart);
- panel.add(ch1);
- dataset.setValue(count, " " , typesPannes[i]);
- dataset.setValue(count, typesPannes[i], "");
Add Comment
Please, Sign In to add comment