Highcharts “打印”菜单中的新链接

Highcharts “打印”菜单中的新链接,highcharts,Highcharts,一页上有10个图形。我想在新页面中显示这些页面上的数据。我制作了export-csv.js insert。我做了添加 $(函数(){ 海图。海图('gool'{ 图表:{ zoomType:'xy' }, 标题:{ id:'101', 文字:“足球傻瓜” `Highcharts.Chart.prototype.downloadItem=函数(){ ` 我无法获取id变量。要使代码正常工作,我应该做些什么?如果您对元素使用自定义属性,那么您可以通过chart.options访问它。在您的情况下,它

一页上有10个图形。我想在新页面中显示这些页面上的数据。我制作了export-csv.js insert。我做了添加

$(函数(){
海图。海图('gool'{
图表:{
zoomType:'xy'
},
标题:{
id:'101',
文字:“足球傻瓜”

`Highcharts.Chart.prototype.downloadItem=函数(){

`
我无法获取id变量。要使代码正常工作,我应该做些什么?

如果您对元素使用自定义属性,那么您可以通过
chart.options
访问它。在您的情况下,它将是
this.options.title.id
如果您对元素使用自定义属性,那么您可以通过
chart.options
访问它。在您的情况下,它是应该是
this.options.title.id

    var url = this.title.textStr.replace(/ /g, '-').toLowerCase();
    var url = this.title.id;

    var left = (screen.width/2)-(750/2);
    var top = (screen.height/2)-(600/2);
    return window.open('itemExport.jsp?Id='+url+asd, 'Export', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+900+', height='+600+', top='+top+', left='+left);

};

// Add "Download CSV" to the exporting menu. Use download attribute if supported, else
// run a simple PHP script that returns a file. The source code for the PHP script can be viewed at
// https://raw.github.com/highslide-software/highcharts.com/master/studies/csv-export/csv.php
if (Highcharts.getOptions().exporting) {
    Highcharts.getOptions().exporting.buttons.contextButton.menuItems.push({
        textKey: 'downloadCSV',
        onclick: function () { this.downloadCSV(); }
    }, {
        textKey: 'downloadXLS',
        onclick: function () { this.downloadXLS(); }
    },{
        textKey: 'downloadItem',
        onclick: function () { this.downloadItem(); }
    });
}