admin管理员组文章数量:1356067
I'm trying to add an export-to-csv option to a Highcharts chart, without actually removing all the default options (print, PNG, JPG, PDF, SVG export). The solution offered in Highcharts add export as csv results in the existing options being blown away, as does trying to use the Exporting class in DotNet.Highcharts. Is there a way to achieve this?
NB: I can see how to achieve what I want by editing exporting.js, but that's not a desirable way to go about it :)
I'm trying to add an export-to-csv option to a Highcharts chart, without actually removing all the default options (print, PNG, JPG, PDF, SVG export). The solution offered in Highcharts add export as csv results in the existing options being blown away, as does trying to use the Exporting class in DotNet.Highcharts. Is there a way to achieve this?
NB: I can see how to achieve what I want by editing exporting.js, but that's not a desirable way to go about it :)
Share Improve this question edited May 23, 2017 at 11:58 CommunityBot 11 silver badge asked Sep 30, 2013 at 10:50 Julia HaywardJulia Hayward 2,1551 gold badge15 silver badges18 bronze badges1 Answer
Reset to default 8You can add the new item to the menu right after you define the chart:
Highcharts.getOptions().exporting.buttons.contextButton.menuItems.push({
text: 'My new button',
onclick: function () {
alert('OK');
}
});
This will keep the default items.
Demo: http://jsfiddle/3GNZC/
本文标签: javascriptHighchartsadd additional export options without losing default onesStack Overflow
版权声明:本文标题:javascript - Highcharts - add additional export options without losing default ones - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744042723a2580960.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论