fusionCharts图表在客户端导出图片
前提:要具备三个文件:FusionCharts.js / FusionChartsExportComponent.js / FCExporter.swf
1.引用 js 文件
<script type="text/javascript" src="">FusionCharts.js / FusionChartsExportComponent.js
2.生成图表 与 导出时保存的按钮
<script type="text/javascript">
$(function() {
var chart_service_chart = new FusionCharts("../FusionCharts/MSColumn3DLineDY.swf", "service_chart", "1024", "500", "0", "1");
chart_service_chart.setDataXML(xmldata数据);
chart_service_chart.render("map");
});
//设置导出的保存按钮
var myExportComponent = new FusionChartsExportObject("fcExporter1", "../FusionCharts/FCExporter.swf");
myExportComponent.componentAttributes.width = '1024';
myExportComponent.componentAttributes.height = '60';
//Background color
myExportComponent.componentAttributes.bgColor = 'ffffdd';
//Border properties
myExportComponent.componentAttributes.borderThickness = '2';
myExportComponent.componentAttributes.borderColor = '0372AB';
//Font properties
myExportComponent.componentAttributes.fontFace = 'Arial';
myExportComponent.componentAttributes.fontColor = '0372AB';
myExportComponent.componentAttributes.fontSize = '12';
//Message - caption of export component
myExportComponent.componentAttributes.showMessage = '1';
myExportComponent.componentAttributes.message = '先右击图表导出,再点击下边按钮进行保存.';
//Button visual configuration
myExportComponent.componentAttributes.btnWidth = '200';
myExportComponent.componentAttributes.btnHeight= '25';
myExportComponent.componentAttributes.btnColor = 'E1f5ff';
myExportComponent.componentAttributes.btnBorderColor = '0372AB';
//Button font properties
myExportComponent.componentAttributes.btnFontFace = 'Verdana';
myExportComponent.componentAttributes.btnFontColor = '0372AB';
myExportComponent.componentAttributes.btnFontSize = '15';
//Title of button
myExportComponent.componentAttributes.btnsavetitle = '保存图表'
myExportComponent.componentAttributes.btndisabledtitle = '等待导出...';
myExportComponent.Render("fcexpDiv");
</script>
可参考:
(下面的写的不错,比较详细)