Bar Charts not getting displayed in Mozilla 31.0 version

UI Components for JSF
Post Reply
sd443b
Posts: 3
Joined: 15 Sep 2014, 20:41

15 Sep 2014, 20:53

Hi,

Currently i am working on a Bar chart web application using Spring webflow and primefaces. While i am able to manage the state of the variables , the bar charts is not getting diplayed . I am using primefaces 5.0.

My .xhtml file is :-

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<f:view contentType="text/html">
<p:inputText value="#{barChartDisplayBean.barchartModel.series[0].label}"></p:inputText> (This is only for debugging)
<p:chart type="bar" model="#{barChartDisplayBean.barchartModel}" style="width:400px;height:300px">
</p:chart>
</f:view>
</ui:composition>

The p:input text which i used for debugging is working. I am able to see the value of the attribute which should have been "boys" which i had set using the action class which is as below : -




public BarChartDisplayBean createBarChartModel(){
BarChartModel barchartModel = new BarChartModel();

ChartSeries boys = new ChartSeries();
boys.setLabel("Boys");
boys.set("2004", 120);
boys.set("2005", 100);
boys.set("2006", 44);
boys.set("2007", 150);
boys.set("2008", 25);



barchartModel.addSeries(boys);
barchartModel.setTitle("Bar Chart");
barchartModel.setLegendPosition("ne");

Axis xAxis = barchartModel.getAxis(AxisType.X);
xAxis.setLabel("Gender");

Axis yAxis = barchartModel.getAxis(AxisType.Y);
yAxis.setLabel("Births");
yAxis.setMin(0);
yAxis.setMax(200);
barChartDisplayBean.setBarchartModel(barchartModel);
return barChartDisplayBean;
}

Could anyone please help me on this?

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

16 Sep 2014, 17:52

ui:composition ?

where is your h:head, <html>, h:body tags? reply with those.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

sd443b
Posts: 3
Joined: 15 Sep 2014, 20:41

18 Sep 2014, 21:09

Hi smithh032772,

Thank you so much for the reply. In your question lied the answer. Once i customized the <h:head>, bingo!!! it worked.
<h:head>
<f:facet name="first">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

</f:facet>
</h:head>

Thanks.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests