How to use a custom download button with default printing options in Highcharts?

ぃ、小莉子 提交于 2019-12-12 01:54:11

问题


I'd like to use a custom printing button for my Highcharts graph. Now, I succeeded in adding it, however, I don't know how to make it display those default printing options (Export as PNG, SVG, JPG, PDF). And how to make disappear that default printing button.

This is the code:

    exporting: {
        buttons: {
            'myButton': {
                _id: 'myButton',
                symbol: 'url(http://geodev.grid.unep.ch/images/button_download.png)',
                onclick: function () {
                    alert('click!')
                }
            }
        }
    }

And here is a fiddle.

Is there any simple approach for that in the "onClick" event it says: "Display all print options"?

Thanks for any suggestions!


回答1:


As Sebastian showed in his example (I deleted a few unnecessary commands), no need to reinvent the wheel, but just to replace the default image is sufficient:

    exporting: {
        buttons: {
            contextButton: {
                symbol: 'url(http://geodev.grid.unep.ch/images/button_download.png)'
            }
        }
    }


来源:https://stackoverflow.com/questions/28209607/how-to-use-a-custom-download-button-with-default-printing-options-in-highcharts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!