title: PrimeFaces pie chart is not displayed in JSF 2.0
body: <p>I want to display primefaces pie chart in my JSF application.</p>
  
  <p>Here is my xhtml page:</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;HTML xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"&gt;
  
  &lt;f:view contentType="text/html"&gt;
      &lt;ui:include src="blocks/head.xhtml"/&gt;
  
      &lt;body&gt;
      &lt;ui:include src="blocks/header.xhtml"/&gt;
  
          &lt;p:pieChart id="sample"
                      value="#{pieChartBean.pieModel}"
                      legendPosition="w"
                      title="Sample Pie Chart"
                      style="width:400px;height:300px"/&gt;
  
      &lt;ui:include src="blocks/footer.xhtml"/&gt;
      &lt;/body&gt;
  &lt;/f:view&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>And here is my bean:</p>
  
  <pre><code>@ManagedBean(name = "pieChartBean")
  @ViewScoped
  public class PieChartBean implements Serializable {
  
     private PieChartModel pieModel;
  
      public PieChartBean() {
          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>I put the bean in the ViewScope, I also tried Session and Request scopes. Problem is that the chart is not displayed in the page. Any ideas where is the problem?</p>
  
  <p>EDITED:
  Strange is this that I tried to add some other component in the same xhmtl page, I added <code>&lt;p:spinner/&gt;</code> and it works. It is showed in my JSF page but chart is not.</p>
  
  <p>EDITED 2:</p>
  
  <p>Firebug:</p>
  
  <pre><code>&lt;div id="sample" style="width:400px;height:300px"&gt;&lt;/div&gt;
  &lt;script id="sample_s" type="text/javascript"&gt;
  $(function(){PrimeFaces.cw('PieChart','widget_sample',{id:'sample',data:[[["Brand 1",540],["Brand 2",325],["Brand 3",702],["Brand 4",421]]],title:'Sample Pie Chart',legend:{show:true,renderer: $.jqplot.EnhancedLegendRenderer,location:'w'},axes:{xaxis:{},yaxis:{}}},'charts');});
  &lt;/script&gt;
  </code></pre>
  
  <p>If I look through the generated HTML source with firebug the code shown above is generated but in browser nothing is displayed.</p>