0
這是我.xhtmlprimefaces線型圖不可見
<div id="detailed_div_graph" align="center">
<p:lineChart id="linear" value="#{ChartBean.linearModel}" legendPosition="e"
title="Medical Data" minY="0" maxY="10" style="height:300px"/>
</div>
這是我的ChartBean
代碼:
public class ChartBean implements Serializable {
private CartesianChartModel linearModel;
public ChartBean() {
createLinearModel();
}
public CartesianChartModel getLinearModel() {
return linearModel;
}
private void createLinearModel() {
linearModel = new CartesianChartModel();
LineChartSeries series1 = new LineChartSeries();
series1.setLabel("BP");
series1.set(1, 2);
series1.set(2, 1);
series1.set(3, 3);
series1.set(4, 6);
series1.set(5, 8);
linearModel.addSeries(series1);
}
}
這有什麼錯我的代碼?