I’m working on a project using Next.js and Highcharts, and I need to implement dynamic export sizes for Highcharts exports. Essentially, I want to allow users to export charts in different sizes, such as small, medium, and large. How can I achieve this functionality?
menuItems: [
"downloadPNG", // this part will download 1090 x 1920
{
text: "Small", // this part will download 100 x 100
onclick: function () {
var confirmed = confirm("Are you sure you want to download the chart as PNG?");
if (confirmed) {
this.exportChartLocal({
type: "image/png",
width: 100, // Set the desired width of the exported image
height: 100, // Set the desired height of the exported image
});
}
},
},
]
However, I’m encountering difficulties with this approach. Can anyone provide guidance on how to implement dynamic export sizes for Highcharts in a Next.js / React.js environment? Any insights or alternative solutions would be greatly appreciated.