I have a rendered chart on a page and I am overwriting the high charts export link to a custom link to be used with a Zend view.
I am new to javascript and I’m not sure how to export to the new tab:
data.chartOptions.exporting.buttons.printButton = {
onclick : function() {
var win=window.open('','','location=0,titlebar=0,status=0,width=780,height=350');
win.focus();
this.exportChart({
url: ***.zendLink({
param1:***,
param2:***,
controller:"spm",
id:data.id,
action:"view",
format:"print"
})
});
}
}
This does not seem to work, The window is opened and the link is followed on the first window, eg not in the new window. How do I do this?
Do I need to load the javascript into the new window?
If you would like any more information please ask. I’m not sure how much of the code you require.
Thanks
You are doing those as two different things.
1) Opening an window.
2) Calling exportChart.
You should open a some page in you site and render the chart there. So should load export chart source also for that.
You can open a window in new tab like this
But, it opens an URL in a new tab.
You should have a chart script in that page, and on load of that page you should call this method