2017-11-08 2 views
0

동일한 페이지에 2 개의 차트가 있습니다. 전설을 한 차트에 표시하고 싶습니다. 둘 다 아니라 전 세계적인 솔루션이 있습니다.동일한보기에 두 개의 차트가있는 경우 Primeface 차트 범례를 독립적으로 표시하거나 숨기는 방법?

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

내 XHTML : 내 자바 스크립트 코드 그게 전부

<p:chart id="chart17" responsive="true" type="bar" model="#{chart17Bean.barModel}" /> 
<p:chart id="chart18" responsive="true" type="bar" model="#{chart18Bean.barModel}" /> 

편집 :

답변

1

이 추가 내가 Primefaces 6.1을 사용하고 페이지

에 다음
function removeLegend() 
{ 
    this.cfg.legend = { 
      show: false 
    }; 
} 

과 기능을 JS 관리 Bean에 추가

barModel.setExtender("removeLegend"); 

여기에서 barModel은 숨겨진 전설이있는 차트 모델입니다.

관련 문제