1
我產生與javascript中的圖像,並顯示結果的模式,但模式的圖像葉子:http://s2.subirimagenes.com/imagen/9603018modal.png如何在模態中顯示primefaces圖表?
這是我的代碼:
XHTML
<h:form id = "form1">
<p:chart widgetVar="chart" style="width:1200px;height:400px" type = "bar" model="#{graphicBean.barModel}" rendered="#{not empty graphicBean.barModel}"/>
<p:commandButton onclick ="exportChart()" value = "Execute"/>
<b:commandButton class="btn btn-primary" value="Show" ajax="true" oncomplete="$('.modalGraphic').modal();return false;" />
</h:form>
<b:modal id="id_modalGraphic" styleClass="modalGraphic" title="Guarda el gráfico">
<h:form id = "resultado">
<h:panelGroup id="output" layout="block" style="width:100px;height:100px"></h:panelGroup>
</h:form>
</b:modal>
的JavaScript
function exportChart() {
$('#resultado\\:output').empty().append(PF('chart').exportAsImage());
}
我想要一張帶有卷軸的短圖片或原始大小的圖片。
謝謝!
也許模態有一定的溢出CSS來顯示的東西,而不是滾動?圖像是否在模態中的正確位置? – Kukeltje