2017-05-07 65 views
1

在一個頁面上有10個圖形。我想在新頁面的這些頁面上顯示數據。我做了export-csv.js插入。我做了補充;打印菜單中的新鏈接highcharts

$(function() { Highcharts.chart('gool', { chart: { zoomType: 'xy' }, title: { id: '101', text: 'Soccer Gool'

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

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(); } 
    }); 
} 

` 我不能得到的ID variable.What我應該做的代碼工作?

回答

0

如果您爲某個元素使用自定義屬性,則可以通過chart.options訪問它。你的情況是this.options.title.id

+0

非常感謝你:) –