您好我正在尝试使用primefaces绘制linegraph。但我得到第一象限的图表,但我也有第四象限的数据。 我的代码是:
Bean类:
私有LineChartModel lineModel1;
@PostConstruct
public void init() {
createLineModels();
}
public LineChartModel getLineModel1() {
return lineModel1;
}
private void createLineModels() {
lineModel1 = initLinearModel();
lineModel1.setTitle("Linear Chart");
lineModel1.setLegendPosition("e");
Axis yAxis = lineModel1.getAxis(AxisType.Y);
yAxis.setMin(-10);
yAxis.setMax(10);
}
private LineChartModel initLinearModel() {
LineChartModel model = new LineChartModel();
LineChartSeries series1 = new LineChartSeries();
series1.setLabel("Series 1");
series1.set(1, -2);
series1.set(0, 1);
series1.set(1, 3);
model.addSeries(series1);
return model;
}
输出Graph如下所示: Generated Graph