Highcharts export chart new window/tab

試著忘記壹切 提交于 2019-12-11 09:48:34

问题


I tried the demo on iPad2. It still opens in same window with the URL export.highcharts.com. How can we open/save the image in new tab/window on iPad2?

Been trying to save/open Highchart images in a new tab.

Reference Link:

How to get the exported image without moving from the current window when using mobile devices

Please advice.


回答1:


I'll post Paweł's answer, for reference.

$(function () {
    $('#container').highcharts({
        
        credits: {
            enabled: false
        },
        
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },
        
        series: [{
            data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]        
        }],
        
        exporting: {
            formAttributes: {
                target: '_blank'
            }
        }
        
    });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>

<div id="container" style="height: 400px; margin-top: 1em"></div>

$(function () { $('#container').highcharts({

    credits: {
        enabled: false
    },

    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]        
    }],

    exporting: {
        formAttributes: {
            target: '_blank'
        }
    }

});

});



来源:https://stackoverflow.com/questions/23889647/highcharts-export-chart-new-window-tab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!