Reputation: 5993
I am trying to get FusionCharts to export.
I have, besides XML files that specify registerWithJS="1",
<script type="text/javascript" src="FusionCharts/FusionCharts.js"></script>
<script type="text/javascript" src="FusionCharts/FusionChartsExportComponent.js"></script>
and
<div class="portlet" id="recent-portfolio-trends">
<div title="View graphs and charts of your portfolio." class="portlet-header">Recent Portfolio Trends</div>
<div class="portlet-content">
<!-- Trends -->
<span id="Trends-OS">FusionCharts will load here!</span>
<span id="Trends-Vol">FusionCharts will load here!</span>
<div id="fcexpDiv">FusionCharts Export Handler Component</div>
<div id="fcexpDiv2">FusionCharts Export Handler Component 2</div>
<script type="text/javascript">
var myChart = new FusionCharts( "FusionCharts/MSColumn2D.swf", "column", "350", "220", "0", "1" );
myChart.setXMLUrl("FusionCharts/trends-outstandings.xml");
myChart.render("Trends-OS");
var myExportComponent = new FusionChartsExportObject("fcExporter1", "FusionCharts/FCExporter.swf");
myExportComponent.debugMode = true;
myExportComponent.exportAttributes.exportAtClient = '1';
myExportComponent.exportFilename = "Outstanding";
myExportComponent.render("fcexpDiv");
</script>
<script type="text/javascript">
var myChart = new FusionCharts( "FusionCharts/MSCombi2D.swf", "column", "350", "220", "0", "1" );
myChart.setXMLUrl("FusionCharts/trends-volume.xml");
myChart.render("Trends-Vol");
var myExportComponent2 = new FusionChartsExportObject("fcExporter2", "FusionCharts/FCExporter.swf");
myExportComponent2.debugMode = true;
myExportComponent2.exportAttributes.exportAtClient = '1';
myExportComponent.exportFilename = "Volume";
myExportComponent2.render("fcexpDiv2");
</script>
Google searching suggests in various forms that I need to specify registerWithJS to be "1", perhaps in more than one place, and that I should get a diagnostic error code in an alert with debugMode set to True. (I do not get an alert or anything on Chrome's JavaScript console.) This is being served up by a distinct web server, so it's not a "local filesystem protection" issue.
What I do get are two charts rendered properly, plus two buttons that say "Waiting" and never, at least after a few minutes, change to say anything else. If I right-click the graphs, the contextmenu offers "Print Chart", "Copy data to clipboard", "About FusionCharts", "Settings...", "Global Settings...", and "About Adobe Flash Player 10.3.181.14..." but not the options to export as JPG, PNG, or PDF that should be available.
Suggestions for what I need to do?
Upvotes: 1
Views: 1178
Reputation: 2482
You would need to set at-least three export related XML attributes in your XML to enable the export related context menu. These are : exportEnabled, exportAtClient and exportHandler.
Hence, your trends-outstandings.xml would contain:
<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' ...>
and trends-volume.xml would contain:
<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter2' ...>
Also please make sure you are using the latest FusionCharts.js and FusionChartsExportComponent.js.
Upvotes: 2