Partage
  • Partager sur Facebook
  • Partager sur Twitter

Jfreechart et PieChart3D

Taille des labels

    13 avril 2011 à 10:32:22

    Bonjour à tous,

    J'utilise le Frameworks Jfreechart pour générer des graphiques 2d/3d, je recherche comment modifier la taille des labels de commentaire. La solution se trouve dans l'objet plot cependant je n'ai pas trouvé la bonne méthode.

    public JPanel createPanelPieIndicators() {
    				
    		this.oPieIndicator = new DefaultPieDataset();
    		
    		JFreeChart chart = ChartFactory.createPieChart3D("", this.oPieIndicator, true, true, false);		
    		chart.setTitle(new TextTitle("répartition des indicateurs", this.oFontTitle));
    		chart.getTitle().setPaint(COLOR_GRAY);
    		chart.setBackgroundPaint(Color.WHITE);		
    		chart.getLegend().setBorder(0, 0, 0, 0);
    				
    		ChartPanel oPanelPieIndicators = new ChartPanel(chart);
    		oPanelPieIndicators.setMinimumDrawWidth(400);
    		oPanelPieIndicators.setMinimumDrawHeight(300);
    		oPanelPieIndicators.setBorder(null);
    		oPanelPieIndicators.setRangeZoomable(true);
    		oPanelPieIndicators.setLayout(new BorderLayout(0, 0));
    		oPanelPieIndicators.setBackground(COLOR_BLUE_SKY);
    		
    		PiePlot3D plot = (PiePlot3D) chart.getPlot();
    
    		plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0}:{1} \n({2})"));	
    		plot.setLabelFont(this.oFontLabelPlot);
    	    plot.setLabelBackgroundPaint(COLOR_BLUE_SKY);
    		plot.setStartAngle(100);		
    		plot.setDirection(Rotation.ANTICLOCKWISE);
    		plot.setForegroundAlpha(0.3f);
    		plot.setBackgroundPaint(Color.WHITE);
    		plot.setOutlineVisible(false);
    				
    		for (int i = 0; i <= this.aPieIndicator.length - 1; i++){
    			plot.setSectionPaint(this.aPieIndicator[i], this.aColorPieIndicator[i]);			
    		}
    			
    		return oPanelPieIndicators;
    	}
    


    Image utilisateur

    Merci d'avance

    Damien
    • Partager sur Facebook
    • Partager sur Twitter

    Jfreechart et PieChart3D

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown