Fusion Chart V3 : Server Side Export of chart - Initiation through custom link and not using context menus
#1
Posted 25 November 2009 - 06:31 AM
I am using fusion chart v3 evalution version for testing right now. we are planning to buy the commercial version of the same.
while testing export chart api with fusion chart v3 i come across below issue.
I am using server side export handler to export chart as PDF/Image as i need to save the PDF/Image to server disk for later use.
So here i am able to export chart using context menu export method. but i need to pass other custom parameter also to the handler method in controller with necessary xml attributes. so how can i pass these parameters ?? also if i do not want to initiate export process through context menu by doing right click on chart but want to initiate export process on click event of custom export link then how can i do that ??
Please reply asap.
Thanks,
Piyush
Other Replies To This Topic
#2
Posted 25 November 2009 - 07:17 AM
You can use javascript to initiate the export. Here is the code:
<script type="text/javascript">
function ExportMyChart() {
var chartObject = getChartFromId('myChart');
if( chartObject.hasRendered() ) chartObject.exportChart();
}
</script>
You can use your custom controller to handle the export, by specifying the exportHandler value in the xml.
You cannot provide custom parameters to your controller, from the chart.
The one way, you could achieve this is by using the existing attributes with a different meaning in your controller.
For example: exportTargetWindow or exportAction.
You could use these attributes as something else in your controller.
Hope this helps.![]()
Srividya
Srividya Sharma
Other Replies To This Topic
#3
Posted 25 November 2009 - 12:32 PM
I have one more question here regarding registartwithJS option. in the documentation it is mentioned that we need to set this attribute at true to enable chart export initiation through javascript but it is not clear that where to set this attribute ?? is it as one of the parameter in the chart xml ??
Thanks,
Piyush
Other Replies To This Topic
#4
Posted 25 November 2009 - 03:12 PM
Here, you would have to use the parameter 'register_with_js' and set it to true.
To register the chart with JavaScript, we set the registerWithJS parameter to 1. It's the last parameter in FusionCharts constructor function.
var chart1 = new FusionCharts("../../FusionCharts/Column3D.swf", "chart1Id", "400", "300", "0", "1");
Ref.- http://www.fusioncha...S_Overview.html
Hope this helps.
Rajroop Bhaduri
FusionCharts Team
Help us improve our documentation with your precious feedback at:
http://documentation...sioncharts.com/
Follow us @Twitter
Other Replies To This Topic
#5
Posted 25 November 2009 - 07:34 PM
If you are using the render_chart function in the view, you could set the registerWithJS value as follows:
#Create the chart - Column 3D Chart with data contained in str_xml render_chart '/FusionCharts/Column3D.swf', '', str_xml, 'productSales', 600, 300, false, true do-%>
Srividya
Srividya Sharma

Back to top
MultiQuote
