JSP FusionCharts Free display chart implementation

Source: Internet
Author: User

FusionCharts Free: http://www.fusioncharts.com/goodies/fusioncharts-free/

Next, introduce js in the jsp page.

Copy codeThe Code is as follows: <script type = "text/javascript" src = "FusionChartsFree/JSClass/FusionCharts. js"> </script>

Then writeCopy codeThe Code is as follows: <script type = "text/javascript">
Var chart = new FusionCharts ("FusionChartsFree/Charts/FCF_Column3D.swf", "column1", "800", "600 ");
Chart. setDataURL ("FusionChartsFree/Gallery/Data/Column3D. xml ");
Chart. render ("div1 ");
</Script>

The parameters in the second line are as follows: the SWF address of the image to be displayed, the id of the image (which can be arbitrarily started, but is unique when multiple images exist on a page), the width of the image, the height of the image;
The third line is to set the XML address for data display;

The fourth line is the id of the DIV as the rendering image parameter;

Appendix:

Copy codeThe Code is as follows: <% @ page language = "java" import = "java. util. *" pageEncoding = "GBK" %>
<%
String path = request. getContextPath ();
String basePath = request. getScheme () + ": //" + request. getServerName () + ":" + request. getServerPort () + path + "/";
%>
<! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN">
<Html>
<Head>
<Base href = "<% = basePath %>">

<Title> Demo </title>
<Script type = "text/javascript" src = "FusionChartsFree/JSClass/FusionCharts. js"> </script>
</Head>

<Body>
<Div id = "div1"> </div>
<Script type = "text/javascript">
Var chart = new FusionCharts ("FusionChartsFree/Charts/FCF_Column3D.swf", "column1", "800", "600 ");
Chart. setDataURL ("FusionChartsFree/Gallery/Data/Column3D. xml ");
Chart. render ("div1 ");
</Script>
</Body>
</Html>

Display 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.