Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static JFreeChart createChart(String title, List <Result> results){
- DefaultPieDataset pieDataset = new DefaultPieDataset();
- Iterator<Result> itr = results.iterator();
- while (itr.hasNext()) {
- Result result = itr.next();
- String itemName = result.getItemName();
- BigDecimal itemResult = result.getItemResult();
- pieDataset.setValue(itemName, itemResult);
- }
- JFreeChart chart = null;
- try {
- chart = ChartFactory.createPieChart(title, pieDataset,true, false, false);
- } catch (Exception e) {
- log.error("Threw a ParseException in createChart:, full message:",
- e);
- }
- return chart;
- }
- ((PiePlot) chart.getPlot()).setLabelGenerator(null);
Add Comment
Please, Sign In to add comment