title: <p:pieChart> does not work using primefaces
body: <p>I am using JSF 2.0 + Prime faces for web project. </p>
  
  <p>My xhtml code is this :</p>
  
  <pre><code>   &lt;p:pieChart id="sample" value="#{chartBean.pieModel}" legendPosition="w"  
                      title="Sample Pie Chart" style="width:400px;height:300px" /&gt;
  </code></pre>
  
  <p>And Java file code is this:</p>
  
  <pre><code>public class ChartBean implements Serializable {  
  
      private PieChartModel pieModel;  
  
      public ChartBean() {  
          createPieModel();  
      }  
  
      public PieChartModel getPieModel() {  
          return pieModel;  
      }  
  
      private void createPieModel() {  
          pieModel = new PieChartModel();  
  
          pieModel.set("Brand 1", 540);  
          pieModel.set("Brand 2", 325);  
          pieModel.set("Brand 3", 702);  
          pieModel.set("Brand 4", 421);  
      }  
  }
  </code></pre>
  
  <p>Any while going to run this code getting this error :</p>
  
  <pre><code>java.lang.NullPointerException
      org.primefaces.component.chart.pie.PieChartRenderer.encodeData(PieChartRenderer.java:68)
      org.primefaces.component.chart.pie.PieChartRenderer.encodeScript(PieChartRenderer.java:51)
      org.primefaces.component.chart.pie.PieChartRenderer.encodeEnd(PieChartRenderer.java:36)
      javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
      javax.faces.component.UIComponent.encodeAll(UIComponent.java:1764)
      javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
      javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
      org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:57)
      org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:45)
      org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:51)
      javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
      javax.faces.component.UIComponent.encodeAll(UIComponent.java:1764)
      javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
      javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
      javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
      com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
      com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
      com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
      com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
  </code></pre>
  
  <p>How is this caused and how can I solve it?</p>