Primefaces 6饼图导出在Safari中不起作用

时间:2016-12-11 15:51:34

标签: primefaces charts jqplot

我正在导出Primefaces饼图,如下所示:

        <p:panel header="My Report" closable="true" toggleable="true">
        <p:chart type="pie" widgetVar="pie"
                 model="#{mybean.pieChartModel}"
                 style="height: 700px; width: 1000px"
                 styleClass="center"/>

        <p:dialog widgetVar="pieDlg" showEffect="fade" modal="true" header="My Chart">
            <p:outputPanel id="pieOut" layout="block" />
        </p:dialog>

        <p:commandLink  id="export" onclick="exportPieChart();">
            <p:graphicImage value="/resources/images/export.png"/>
        </p:commandLink>
        <p:tooltip for="export"  value="Export Chart" showEffect="fade" hideEffect="fade"/>
    </p:panel>

    <script type="text/javascript">
        function exportPieChart() {
            //export image
            $('#pieOut').empty().append(PF('pie').exportAsImage());
            //show the dialog
            PF('pieDlg').show();
        }
    </script>

适用于Firefox和Chrome。但不适用于Chrome和Safari。

Firefox日志消息:

  

主线程上的同步XMLHttpRequest因其对最终用户体验的不利影响而被弃用。如需更多帮助http://xhr.spec.whatwg.org/

相同的代码适用于导出条形图。

二手平台: JavaEE 7,Primefaces 6和Glassfish 4.1

提前致谢

0 个答案:

没有答案