Hello!
Just curious if there was a way to customize what links appear in the export menu dropdown. I would love to be able to offer the social share links but not the "edit" link, for example?
Thanks!
Jen
Code: Select all
options.exporting = {
buttons: {
contextButton: {
menuItems: [{
textKey: 'printChart',
onclick: function () {
this.print();
}
}, {
separator: true
}, {
textKey: 'downloadPNG',
onclick: function () {
this.exportChart();
}
}, {
textKey: 'downloadJPEG',
onclick: function () {
this.exportChart({
type: 'image/jpeg'
});
}
}, {
separator: true
},{
textKey: 'downloadPDF',
onclick: function () {
this.exportChart({
type: 'application/pdf'
});
}
}, {
textKey: 'downloadSVG',
onclick: function () {
this.exportChart({
type: 'image/svg+xml'
});
}
}]
}
}
};
Code: Select all
Highcharts.extend(options, Highcharts.merge(options, {
exporting:{
buttons: {
contextButton: {
menuItems: [{
textKey: 'printChart',
onclick: function () {
this.print();
}
}, {
separator: true
}, {
textKey: 'downloadPNG',
onclick: function () {
this.exportChart();
}
}, {
textKey: 'downloadJPEG',
onclick: function () {
this.exportChart({
type: 'image/jpeg'
});
}
}, {
textKey: 'downloadPDF',
onclick: function () {
this.exportChart({
type: 'application/pdf'
});
}
}, {
textKey: 'downloadSVG',
onclick: function () {
this.exportChart({
type: 'image/svg+xml'
});
}
}]
}
}}
}));
Code: Select all
Highcharts.extend(options, Highcharts.merge(options, {
exporting: {
buttons: {
contextButton: {
menuItems: [{
"text": "<a href=\"https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fcloud.highcharts.com%2Fshow%2FCHART_ID\" target=\"_blank\">Share on Facebook</a>"
}, {
"text": "<a href=\"https://plus.google.com/share?url=http%3A%2F%2Fcloud.highcharts.com%2Fshow%2FCHART_ID\" target=\"_blank\">Share on Google+</a>"
}, {
"text": "<a href=\"https://twitter.com/share?url=http%3A%2F%2Fcloud.highcharts.com%2Fshow%2FCHART_ID&text=Your chart\" target=\"_blank\">Share on Twitter</a>"
}, {
"text": "<a href=\"http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fcloud.highcharts.com%2Fshow%2FCHART_ID\" target=\"_blank\">Share on LinkedIn</a>"
}, {
"separator": true
}, {
"textKey": "printChart"
}, {
"separator": true
}, {
"textKey": "downloadPNG"
}, {
"textKey": "downloadJPEG"
}, {
"textKey": "downloadPDF"
}, {
"textKey": "downloadSVG"
}]
}
}
}
}));