打开包含Highcharts的页面时停止打印对话框

时间:2013-07-25 06:53:02

标签: javascript printing dialog highcharts

当我打开包含Highcharts的页面时(我使用3个饼图),打印对话框总是显示,我不知道它是怎么来的并且要停止它。

这是js代码:

<script type="text/javascript">
        $(document).ready(function() {
        var options = {
            chart: {
                renderTo: 'users_contain',
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false
            },
            title: {
                text: 'Users'
            },
            // exporting: {
                // buttons: { 
                    // exportButton: {
                        // enabled:true
                    // },
                    // printButton: {
                        // enabled:false
                    // }

                // }
            // },
            exporting: {
                     enabled: false
            },
            tooltip: {
                formatter: function() {
                    return '<b>'+ this.point.name +'</b>: '+ Highcharts.numberFormat(this.percentage,2) +' %';
                }
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: true,
                        color: '#000000',
                        connectorColor: '#000000',
                        formatter: function() {
                            return '<b>'+ this.point.name +'</b>: '+ Highcharts.numberFormat(this.percentage,2) +' %';
                        }
                    }
                }
            },
            series: [{
                type: 'pie',
                name: 'User Usage',
                data: []
            }]
        } 
        $.getJSON("data/account_preview/user_usage.php", function(json) {
            options.series[0].data = json;
            chart = new Highcharts.Chart(options);
        });    

    });     

    </script>   

我尝试通过添加此

来修改其导出
exporting: {
    enabled: false
}

exporting: {
      buttons: { 
                 exportButton: {
                      enabled:false
                 },
                 printButton: {
                      enabled:false
                 }
              }
          }

但是,它也没有用,只是在图表中禁用导出按钮。

任何人都知道,当我打开包含highcharts的页面时如何停止打印对话框? 感谢的。

0 个答案:

没有答案
相关问题