Java implements the function of exporting images or PDF files from FusionCharts charts

Source: Internet
Author: User

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 ~

 


 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.