barChart에 문제가 있습니다. Primeface에서 barCharts에 대한 예제를 작성했지만 페이지에는 볼 수 없습니다. 다음은 Bean 클래스 PrimeFaces 막대 차트가 표시되지 않습니다.
: 여기import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import org.primefaces.model.chart.CartesianChartModel;
import org.primefaces.model.chart.ChartSeries;
@ManagedBean
@ViewScoped
public class InvoiceStatisticsBean implements Serializable {
private CartesianChartModel categoryModel;
public InvoiceStatisticsBean() {
categoryModel = new CartesianChartModel();
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);
ChartSeries girls = new ChartSeries();
girls.setLabel("Girls");
girls.set("2004", 52);
girls.set("2005", 60);
girls.set("2006", 110);
girls.set("2007", 135);
girls.set("2008", 120);
categoryModel.addSeries(boys);
categoryModel.addSeries(girls);
}
public CartesianChartModel getCategoryModel() {
return categoryModel;
}
public void setCategoryModel(CartesianChartModel categoryModel) {
this.categoryModel = categoryModel;
}
}
그리고는 .xhtml 파일 : 나쁜 편집 죄송합니다
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Invoice Statistics</title>
</h:head>
<h:body>
<ui:composition template="/templates/layout.xhtml">
<ui:define name="header">
<h1>Invoice Statistics</h1>
</ui:define>
<ui:define name="content">
<p>There should be a barChart</p>
<p:barChart id="horizontal" value="#{invoiceStatisticsBean.categoryModel}" legendPosition="se" style="height:300px" title="Horizontal Bar Chart" orientation="horizontal" min="0" max="200"/>
<p:outputPanel>test</p:outputPanel>
</ui:define>
</ui:composition>
</h:body>
</html>
하지만 여기 내 첫 번째 질문입니다.
그렇다면 .xhtml 페이지를 시작하면 barChart의 공간이 페이지에 예약되어 있지만 아무 것도 표시되지 않습니다.
누구든지이 문제로 제발 도와 줄 수 있습니까?
–