Javascript 如何在highcarts中查找标题

Javascript 如何在highcarts中查找标题,javascript,printing,highcharts,menu,Javascript,Printing,Highcharts,Menu,我想在“打印”菜单中添加新项。你可以在底部看到我的作品。请帮助我了解这个话题 var url = chart.title.textStr.replace(/ /g, '-').toLowerCase(); var left = (screen.width/2)-(750/2); var top = (screen.height/2)-(600/2); return window.open('itemExport.jsp?Id='+url, 'Export', 'toolb

我想在“打印”菜单中添加新项。你可以在底部看到我的作品。请帮助我了解这个话题

var url = chart.title.textStr.replace(/ /g, '-').toLowerCase();
    var left = (screen.width/2)-(750/2);
    var top = (screen.height/2)-(600/2);
    return window.open('itemExport.jsp?Id='+url, '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);

您可以使用
chart.options.title.text

此标题添加到导出菜单中,如下所示:

演示


您想在打印菜单项时准确地将图表标题放在项中吗?我想这样做‘Highcharts.chart.prototype.downloadItem=function(){var url=Highcharts.chart.setTitle;var left=(screen.width/2)-(750/2);var top=(screen.height/2)-(600/2);return window.open('itemExport.jsp?Id='+url',Export','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=no,copyhistory=no,width='+900+',height='+600+',top='+top+',left='+left);;;'Check fiddle demo first我尝试了这个解决方案,我的项目工作正常,非常感谢。
    Highcharts.getOptions().exporting.buttons.contextButton.menuItems.push({
      text: chart.options.title.text,
      onclick: function() {
        alert('OK');
       /*call custom function here*/
      }
   });