Implementation of JSP FusionCharts free display chart

Time:2021-2-12

Download address of FusionCharts free: http://www.fusioncharts.com/goodies/fusioncharts-free/

Next, introduce JS into the JSP page

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

Then write it

Copy 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 of the second line are as follows: SWF address of the graph to be displayed, ID of the graph (it can start at will, but it is unique when there are multiple graphs on a page), width and height of the graph;
The third line is to set the address to display the Data XML;

The fourth line is the ID of div, which is the rendering parameter;

Attached:

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></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:
Implementation of JSP FusionCharts free display chart

Recommended Today

The use of springboot Ajax

Ajax overview What is Ajax? data Ajax application scenarios? project Commodity system. Evaluation system. Map system. ….. Ajax can only send and retrieve the necessary data to the server, and use JavaScript to process the response from the server on the client side. data But Ajax technology also has disadvantages, the biggest disadvantage is that […]