1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| private JFreeChart createChart(){
JFreeChart localJFreeChart = ChartFactory.createPieChart((String) list_lignes.get(0).get(0).get(6), createDataset(frais_fixe), true, true, false);
if((Boolean) list_lignes.get(0).get(0).get(7)){
localJFreeChart.addSubtitle(new TextTitle((String) list_lignes.get(0).get(0).get(8), new Font("Dialog", 0, 12)));
}
localPiePlot = (PiePlot)localJFreeChart.getPlot();
localPiePlot.setSectionPaint("Dépense", new Color(254, 72, 68));
localPiePlot.setSectionPaint("Recette", new Color(17, 124, 78));
localPiePlot.setSectionPaint("Dépense Frais non fixe", new Color(250, 126, 117));
localPiePlot.setSectionPaint("Recette Frais non fixe", new Color(35, 174, 114));
localPiePlot.setSectionPaint("Five", new Color(32, 32, 127));
localPiePlot.setSectionPaint("Six", new Color(0, 0, 111));
localPiePlot.setNoDataMessage("Aucune donnée disponible");
if(frais_fixe){
localPiePlot.setExplodePercent("Dépense Frais non fixe", 0.2D);
localPiePlot.setExplodePercent("Recette Frais non fixe", 0.2D);
}
else{
localPiePlot.setExplodePercent("Dépense Frais non fixe", 0D);
localPiePlot.setExplodePercent("Recette Frais non fixe", 0D);
}
localPiePlot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} | {2}"));
localPiePlot.setLabelBackgroundPaint(new Color(220, 220, 220));
localPiePlot.setLegendLabelToolTipGenerator(new StandardPieSectionLabelGenerator("{0} | {1} | {2}"));
//localPiePlot.setSimpleLabels(true);
localPiePlot.setInteriorGap(0.0D);
return localJFreeChart;
} |
Partager