1,加入jar包(fcexporter.jar ;fcexporthandler.jar ),FCExporter.swf,FusionChartsExportComponent.js
2,拷贝文件FCExporter.php到
WebContent/jsp/ExportHandlers/PHP/FCExporter.php
3,web.xml加入servlet
<servlet>
<display-name>FCExporter</display-name>
<servlet-name>FCExporter</servlet-name>
<servlet-class>com.fusioncharts.exporter.servlet.FCExporter</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>FCExporter</servlet-name>
<url-pattern>/jsp/ExportHandlers/PHP/FCExporter</url-pattern>
</servlet-mapping>
servlet的url-pattern和上面的文件FCExporter.php路径要一致,去掉后缀.php
4,加入配置文件fusioncharts_export.properties,放在claess路径下(最后到工程的WEB-INF\classes下就对了,里面的属性自己看着改)
#Please specify the path to a folder with write permissions relative to web application root
#SAVEPATH=./tempphoto/
SAVEPATH=./tempExport/
#Please specify the path to a folder with write permissions relative to web application root
#the folder where exported charts will be saved.
#the folder where exported charts will be saved.
#in this constant e.g., http://www.yourdomain.com/images/
#HTTP_URI=http://lsy.helpdesk.citicsinfo.com/tempphoto/
HTTP_URI=http://lsy.helpdesk.citicsinfo.com/tempExport/
#OVERWRITEFILE sets whether the export handler will overwrite an existing file
#the newly created exported file. If it is set to false the export handler will
#not overwrite. In this case if INTELLIGENTFILENAMING is set to true the handler
#will add a suffix to the new file name. The suffix is a randomly generated UUID.
#Additionally, you can add a timestamp or random number as additional prefix.
OVERWRITEFILE=false
INTELLIGENTFILENAMING=true
FILESUFFIXFORMAT=TIMESTAMP
5,在报表的xml数据中药加入几个属性。
' exportEnabled="1" exportAtClient="0" exportAction="save"'
' exportHandler="http://lsy.helpdesk.citicsinfo.com/jsp/ExportHandlers/PHP/FCExporter"'
' exportCallback="myCallBackFunction" '
其中exportHandler="http://lsy.helpdesk.citicsinfo.com/jsp/ExportHandlers/PHP/FCExporter
是你刚才注册的servlet的请求路径,比如http://xxx:8080/aaa,这里我完整的请求就是上面的路径。
例子:
var dataString11 ='<chart caption="呼入总数 " palette="2" xAxisName="" '
+'yAxisName="单位:个" formatNumberScale="0" numberPrefix="" '
+'labeldisplay="ROTATE" slantLabels="1" sNumberSuffix=