Define Highcharts Export Options
We’re currently using the WebDataRocks Highcharts integration, and allowing customers to export the chart via highcharts.export. Unfortunately the export is being rendered with cut-off legends.
Normally, you can provide an export:
key in the Highcharts options when creating a new chart. Is there a way to specify the export
options via the integration without setting it at a global level?
1 answer
Hello, Ryan,
Thank you for contacting us.
In order to pass more options to the Highcharts, it is possible to modify the data
object right before it is passed as an argument to the Hightchart.chart()
method.
Please check out the code snippet below, demonstrating an explicit including of legends while exporting:
function createChart() {
pivot.highcharts.getData(
{
type: "line"
},
function (data) {
data.exporting = {
chartOptions: {
plotOptions: {
series: {
showInLegend: true
}
}
}
};
console.log(data);
Highcharts.chart("highchartsContainer", data);
},
function (data) {
Highcharts.chart("highchartsContainer", data);
}
);
}
Please see an example demonstrating the described approach.
Other options unavailable by default can be adjusted using the data
object modification as well.
We hope it works for you.
Do not hesitate to contact us in case of additional questions.
Best regards,
WebDataRocks Team