Affichage LineChart JSF et PrimeFaces
Bonjour,
je voudrais afficher line chart dans ma page jsf mais le linechart ne s'affiche pas
je fais le debug et les données sont insérerés dans l'objet linechart
dans les axes des abscisses j'ai fait le cast de mes dates en string et dans les axes des ordonnées j'ai des flots ,
j'ai suivi l'exmple de primefaces Date
mon code xhtml :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
<h:form id="form1">
<p:panel id="panel" header="Paramétres">
<h:panelGrid columns="4" cellpadding="6">
<p:outputLabel for="datedebut" value="Date début" />
<p:calendar size="" id="datedebut" value="#{httpMB.choix.startdate}" pattern="dd/MM/yyyy HH:mm:ss" showOn="button" required="true" />
<p:outputLabel for="datefin" value="Date fin" />
<p:calendar id="datefin" value="#{httpMB.choix.endDate}" pattern="dd/MM/yyyy HH:mm:ss" showOn="button" required="true" />
<p:outputLabel for="host" value="Nom du host" />
<h:inputText id="host" value="#{httpMB.choix.host}" required="true" ></h:inputText>
</h:panelGrid>
<p:commandButton value="Valider" icon="ui-icon-check" actionListener ="#{httpMB.createRTTChart}" ajax="false" update=":form1:outlineRtt" >
</p:commandButton>
</p:panel>
<p:chart type="line" id="outlineRtt" model="#{httpMB.dataRTT}" style="height:400px;"/> |
la méthode qui va crée le lineChart:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
private LineChartModel dataRTT = new LineChartModel();
LineChartSeries seriesRTT = new LineChartSeries();
public void createRTTChart(){
seriesRTT.setLabel("series RTT");
// {...traitement pour remplir dataRTT..}
dataRTT.addSeries(seriesRTT);
dataRTT.setTitle("RTT");
dataRTT.setZoom(true);
dataRTT.getAxis(AxisType.Y).setLabel("Values");
DateAxis axis = new DateAxis("Dates");
axis.setTickAngle(-50);
axis.setTickFormat("%d/%m/%y %H:%M:%S, %y");
dataRTT.getAxes().put(AxisType.X, axis); |
merci d'avance