2016-09-16 2 views
1

내 막대 및 원형 차트에 범례가 표시되지 않습니다. setLegendPlacementsetLegendPosition 메서드에 대해 여러 개의 인수를 시도했지만 결과가 없습니다.Primefaces 5.1 : 막대 및 원형 차트에 범례가 표시되지 않습니다.

내가 잘못 갔습니까? 자바 8, JSF 2.1.28, 5.1 primefaces :

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); 

내 스택 : 이것은 원형 차트에 대한 내 설정이다

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); 

:

이는 막대 차트 내 설정이다 primefaces-테마 1.0.10

+0

훨씬 더 많은 도움을 받으려면 [mcve] – Gimby

답변

0

드로잉 전에 후크 truelegend.show에 속성을 설정함으로써 해결 :

$.jqplot.preDrawHooks.push(function() { 
    this.legend.show = true; 
}); 

Primefaces 5.1은이 속성을 기본적으로 설정하지 않는 것 같습니다.

관련 문제