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

Popular posts from this blog

python - How to create jsonb index using GIN on SQLAlchemy? -

PHP DOM loadHTML() method unusual warning -

c# - TransactionScope not rolling back although no complete() is called -