javascript - Highcharts custom export hidding on Reset -
i facing 1 issue highcharts.
i have code renders custom download instead of highcharts default print , download :
$('#container').highcharts({ exporting: { buttons: { contextbutton: { enabled: false }, exportbutton: { text: 'download', y:30, //x: 1, //y: 5, // use download related menu items default context button menuitems: highcharts.getoptions().exporting.buttons.contextbutton.menuitems.splice(2) }, printbutton: { text: 'print', y: 30, onclick: function () { this.print(); } } } } });
this code working fine when call once, when call again without refreshing page, download button not show me options such download pdf, download image etc.
any help?
thanks.
that line culprit:
highcharts.getoptions().exporting.buttons.contextbutton.menuitems.splice(2)
splice
modifies array. after first call, menuitems
isn't same. use slice()
instead:
highcharts.getoptions().exporting.buttons.contextbutton.menuitems.slice(2)
Comments
Post a Comment