voivi mon probleme :

Nom : chart.jpg
Affichages : 898
Taille : 122,3 Ko

il me retourne null au lieu de m'afficher le graphe de stat..
quelqu'un pourai avoir une idèe?
voici le code de ma classe chartController
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
 
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.appGestionIntervention.JsfClasses;
import com.intervention.jsf.beans.intervenant;
import java.io.Serializable;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.persistence.EntityManager;
import org.primefaces.model.chart.ChartSeries;
import org.primefaces.model.chart.CartesianChartModel;
import org.primefaces.model.chart.PieChartModel;
import javax.persistence.PersistenceContext;
 
/**
 *
 * @author pc_ahmed
 */
import javax.persistence.PersistenceContext;
@ManagedBean
@SessionScoped
public class ChartsControlle implements Serializable{
    @PersistenceContext(unitName = "AppGestionInterventionPU")
    private  EntityManager em;
    private List<InterventionController> intervention;
    private PieChartModel pieModel;
    private CartesianChartModel categoryModel;
 
 
    public ChartsControlle(){
        pieModel = new PieChartModel();
        pieModel.set("", 0);
        categoryModel = new CartesianChartModel();
        ChartSeries ser = new ChartSeries();
       ser.set("", 0);
       categoryModel.addSeries(ser);
    }
public void chaajum(){
 
    pieModel = new PieChartModel();
     categoryModel = new CartesianChartModel();
             ChartSeries ser = new ChartSeries();
             ser.setLabel("SERIE");
             List<Object[]> pielist= ( List<Object[]>)
                     em.createQuery("select numero_reclamation,matricule_intervenant,etat,count(numero_intervention) as numero from intervention m group by numero_reclamation order by count(numero_intervention) desc").getResultList();       
             if(pielist!=null){
 
                 for(Object[] pie: pielist){
                  pieModel.set((String) pie[0], (Number) pie[1]);
                  ser.set((String) pie[0], (Number) pie[1]);
 
                 }
                 categoryModel.addSeries(ser);
             }
 
}
 
    public PieChartModel getPieModel() {
        return pieModel;
    }
 
    public CartesianChartModel getCategoryModel() {
        return categoryModel;
    }
 
    public void setPieModel(PieChartModel pieModel) {
        this.pieModel = pieModel;
    }
 
    public void setCategoryModel(CartesianChartModel categoryModel) {
        this.categoryModel = categoryModel;
    }
 
 
 
            }
et le code xhtml

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
         <p:commandButton actionListener="#{chartsControlle.chaajum()}" value="Preview"  ajax="true" oncomplete="PF('dlgChart').show()" update=":frmChart:pnChart"/>
                        </f:facet>
                    </p:dataTable>
                </p:panel>
            </h:form>
            <h:form id="frmChart" >
                <p:dialog id="dlgChart" widgetVar="dlgChart" modal="true" header="Intervention" appendTo="@(body)">
 
                    <p:panel id="pnChart" style="border-style:none; ">
 
                        <p:panelGrid columns="2">
 
                            <p:pieChart id="pieChart" value="#{chartsControlle.pieModel}" sliceMargin="5" legendPosition="e"  style="width: 400px;height: 300px" showDataLabels="true" title="pieChart"/>
                            <p:barChart id="basic" value="#{chartsControlle.categoryModel}" legendPosition="ne"  title="Bar chart" style="width: 400px;" animate="true" />
                        </p:panelGrid>
                    </p:panel>
                </p:dialog>
et voici ma ma table dans la base de donnèe :
Nom : tableintervention.jpg
Affichages : 816
Taille : 212,2 Ko