如何使用downloadAsImage()
以PNG格式下载/打印图表?
我使用了exportToChart()
,如下所述,但它只显示现有图表下的图表。
<h:form id="exportForm">
<h:commandButton id="exportButton" value="Export as Image"
onclick="exportChart.exportToImage(ice.ace.jq('.chartExport'));
return false;" />
<ace:chart ...
widgetVar="exportChart" />
</h:form>
<h:graphicImage styleClass="chartExport" />
修改
试过这个:
<ice:commandButton value="Print"
onclick="$('barChart').printElement();" >
<ace:printer for="barChart"></ace:printer>
</ice:commandButton>
其中 barChart
是图表的ID。这仅打印图例和数值,但不打印实际图形。