【发布时间】:2016-09-16 07:35:39
【问题描述】:
我的条形图和饼图中没有显示图例。
我为setLegendPlacement 和setLegendPosition 方法尝试了几个参数,但都没有结果。
我哪里出错了?
这是我的条形图配置:
BarChartModel model = new BarChartModel();
model.setZoom(true);
model.setLegendPlacement(LegendPlacement.INSIDE);
model.setLegendPosition("ne");
model.setAnimate(true);
model.setMouseoverHighlight(true);
model.setShowPointLabels(true);
ChartSeries myChartSeries = new ChartSeries();
bank.setLabel("myChatSeries");
for (String key : datas.keys()) {
bank.set(key, datas.get(key));
}
model.addSeries(myChartSeries);
Axis yAxis = model.getAxis(AxisType.Y);
yAxis.setLabel(status.name());
yAxis.setMin(0);
yAxis.setMax(maxCount+1);
yAxis.setTickInterval("2");
Axis xAxis = model.getAxis(AxisType.X);
xAxis.setTickAngle(-20);
这是我的饼图配置:
PieChartModel model = new PieChartModel();
model.setLegendPosition("ne");
model.setLegendPlacement(LegendPlacement.INSIDE);
model.setTitle("Informations général");
model.setMouseoverHighlight(true);
model.setShowDataLabels(true);
model.set("type1", 3);
model.set("type2", 6);
model.set("type3", 8);
我的堆栈:java 8、jsf 2.1.28、primefaces 5.1、primefaces-themes 1.0.10
【问题讨论】:
-
要获得更高的帮助机会,请考虑创建minimal reproducible example
标签: jsf jsf-2 primefaces charts