Java Implementation Fusioncharts Chart export picture or PDF file function

Source: Internet
Author: User

The first step: the introduction of the Fusioncharts file, the version used is: Fusioncharts 3.2.1 (amount, share version, you understand, follow-up provide download link) support Genuine, official address: http://www.fusioncharts.com/

Step two: Introduce the Fcexporter.jar package (image export function library) and configure the following code in the Web. xml file

<servlet>    <display-name>FCExporter</display-name>    <servlet-name>FCExporter< /servlet-name>    <servlet-class>com.fusioncharts.exporter.servlet.FCExporter</servlet-class> </servlet><servlet-mapping>    <servlet-name>FCExporter</servlet-name>    < Url-pattern>/fcexporter</url-pattern></servlet-mapping>

The third step: Add the test XML file, the actual development should use the dynamic URL pattern, otherwise the browser will have a cache

<chart basefont= ' Arial ' basefontsize= ' decimals= ' 0 ' exportenabled= ' 1 ' exportatclient= ' 0 ' exportaction= ' Download ' exportdialogmessage= ' is exporting, please wait ... ' exporthandler= ' fcexporter ' exportshowmenuitem= ' 1 ' exportformats= ' JPG= Export as JPG picture | png= export to PNG pictures | pdf= Export to PDF file ' formatnumberscale= ' 0 ' showvalues= ' 1 ' caption= ' total sales distribution for each heading year ' subcaption= ' 2014 ' exportfilename= ' 2014 Annual total sales distribution map ' palette= ' 4 ' numberprefix= ' ¥ ' ><categories><category label= ' "></category> <category label= ' ></category><category label= ' ></category><category label= ' 04 ' ></category><category label= ' ></category><category label= ' ></category> <category label= ' ></category><category label= ' ></category><category label= ' 09 ' ></category><category label= ' ></category><category label= ' one ' ></category> <category label= ' ></category></categories><set label= ' mobile hdd ' value= ' 3200000 ' ></set><set label= ' desktop computer ' value= ' 3200000 ' ></set><set label= ' multifunction machine ' value= ' 4600000 ' ></set></chart>
Fourth step: Writing a JSP file

<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "pageencoding=" UTF-8 "%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >Fifth step: Start the project and see the effect.



Complete Example: http://download.csdn.net/detail/for_china2012/8314697

Java Implementation Fusioncharts Chart export picture or PDF file function

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.