Hi!
You can use the following settings to add custom toolbar item.
The click on a "gear" icon will trigger download / open image in new tab.
...
toolbar: {
extraItems: [
{
label: "Toggle zoom",
align: "left",
image: "https://zoomcharts.com/dvsl/data/gears.png",
//bind action:
onClick: function () {
//call function when toolbar item is clicked:
nc.exportAsString(
"png", //type of export
function(dataUri, mimeType, extension) { //callback
//--- open image in new tab:
window.open(dataUri);
//--- or trigger image download:
//var link = document.createElement('a');
//link.href = dataUri;
//link.download = 'Download.jpg';
//document.body.appendChild(link);
//link.click();
},
{
//height:300, //optionally set different height
//width:500, //optionally set different width
scaling:1,
unit:"px"
},
true //whether to create png transparent or not
);
}
}
]
}