Java implements the function of exporting images or PDF files from FusionCharts charts
Step 1: Introduce the FusionCharts file, the version used is: FusionCharts 3.2.1 (amount, shared version, you know, follow-up download link) support genuine, official website address: http://www.fusioncharts.com/
Step 2: Introduce the fcexporter. jar package (image export function library) and configure the following code in the web. xml file:
FCExporter
FCExporter
com.fusioncharts.exporter.servlet.FCExporter
FCExporter
/FCExporter
Step 3: add the test xml file. The dynamic URL mode should be used in actual development; otherwise, the browser will cache
Step 4: Compile JSP files
<%@ page language=java contentType=text/html; charset=UTF-8 pageEncoding=UTF-8%>
<Script type = text/javascript src =$ {pageContext. request. contextPath}/scripts/jquery-1.8.3.min.js> </script> <script type = text/javascript src =$ {pageContext. request. contextPath}/plugins/FusionCharts 3.2.1/Scripts/FusionCharts. js> </script> <script type = text/javascript src =$ {pageContext. request. contextPath}/plugins/FusionCharts 3.2.1/Scripts/FusionChartsExportComponent. js> </script> <script type = text/plain cr Ipt> | r | $ (function () {| r | var chart = new FusionCharts ($ {pageContext. request. contextPath}/plugins/FusionCharts 3.2.1/Charts/Pie3D.swf, chart, 720,420); | r | chart. setDataURL ($ {pageContext. request. contextPath}/database/chartData. xml); | r | chart. render (divChart); | r |}); | r | </script> www.bkjia.com Step 5: start the project and check the effect ~