我無法將素數面圖導出爲圖像。。不能在Primefaces中將圖表導出爲圖像?
categoryModel
是一樣的總理出現在酒店。
它需要依賴lib來導出嗎?
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
......
template="/common/commonLayout.xhtml">
<ui:define name="content">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript">
//<![CDATA[
function exportChart() {
//export image
$('#output').empty().append(chart.exportAsImage());
//show the dialog
dlg.show();
}
//]]>
</script>
<h:form enctype="multipart/form-data">
<p:barChart id="basic" value="#{ChartActionBean.categoryModel}" legendPosition="ne"
title="Bar Chart" widgetVar="chart" animate="true" yaxisLabel="Number of Count"/>
<p:commandButton type="button" value="Export" icon="ui-icon-extlink" onclick="exportChart()"/>
<p:dialog widgetVar="dlg" showEffect="fade" modal="true" header="Chart as an Image">
<p:outputPanel id="output" layout="block" style="width:500px;height:300px"/>
</p:dialog>
</h:form>
</ui:define>
</ui:composition>