Working with PieChartModel in JSF 1.2
I am developing an appication for multiple ping testing to different Ips
at a time. That is working fine but I have two issues described below
I have to display that in the Pie chart format. When I run multiple ping
page and get the response back I could see the Pie chart created but not
everytime, sometime its blank not even Pie Diagram is created.
Now If the Pie chart gets created and suppose in the same session I use
another file with set of different Ips and run the MultiplePingTesting
page, I could see the same earlier pie diagram with no updates as per the
new file. I know its a very silly question but i am not able to get way
out of it.
It would be great if someone can help me out.
Bean Class
package My_Package;
import java.io.Serializable;
import org.primefaces.model.chart.PieChartModel;
public class ChartBean implements Serializable {
private PieChartModel pieModel;
public ChartBean() {
createPieModel();
}
public PieChartModel getPieModel() {
return pieModel;
}
private void createPieModel() {
pieModel = new PieChartModel();
pieModel.set("Connected",MultiplePingTesting.i);
pieModel.set("Not Connected",MultiplePingTesting.j);
//MultiplePingTesting is the class which is responsible for multiple
ping testing
}
}
XHTML code
<p:pieChart id="sample" value="#{ChartBean.pieModel}" legendPosition="w"
title="Sample Pie Chart" dataFormat= "Value"
style="width:400px;height:300px" />
No comments:
Post a Comment