Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Chapter 5 Configure charts' export parameters using JavaScript As the context menu allowed us to select whether to export the chart as an image or as PDF, we needed to do something similar when exported by clicking buttons. Time for action create separate buttons to export the chart as image and PDF 1. 2. Create a copy of ExportUsingJavaScriptAPI.html and save it as ExportUsingJavaScriptAPI2.html Open this file in a text editor and replace the entire beginExportChart function with the following modified variant: function beginChartExport (format) { if(chartObj.hasRendered && chartObj.hasRendered()) { chartObj.exportChart({ exportFormat: format }); document.getElementById("exporterContainer").innerHTML = ""; } else { alert("Please wait for the chart to render."); } }