WEB开发网
开发学院图形图像Flash Flash图表(FusionChartsV3)的简单应用 阅读

Flash图表(FusionChartsV3)的简单应用

 2009-01-22 11:55:02 来源:WEB开发网   
核心提示: jsp:<%@ page language="java" pageEncoding="UTF-8"%><%@page import="com.eline.epicc.utils.ChartUtils"%>&

jsp:

<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.eline.epicc.utils.ChartUtils"%>
<%@page import="com.eline.epicc.utils.Constants"%>
<HTML>
  <HEAD>
    <TITLE>FusionCharts - Simple Column 3D Chart</TITLE>
  </HEAD>
  <BODY>
    <%
      //文件源示例
      ChartUtils.outChartSourceHTML("common/charts/Column3D.swf",
          "data.xml", "myFirst", 600, 300, response);
      String[][] arrData = new String[6][2];
      //产品名字
      arrData[0][0] = "Product A";
      arrData[1][0] = "Product B";
      arrData[2][0] = "Product C";
      arrData[3][0] = "Product D";
      arrData[4][0] = "Product E";
      arrData[5][0] = "Product F";
  
      arrData[0][1] = "567500";
      arrData[1][1] = "815300";
      arrData[2][1] = "556800";
      arrData[3][1] = "734500";
      arrData[4][1] = "676800";
      arrData[5][1] = "648500";
      //Now, we need to convert this data into XML. We convert using string concatenation.
      String strXML;
      int i = 0;
      strXML = "<chart caption='Sales by Product' numberPrefix='$' formatNumberScale='0'>";
      for (i = 0; i < arrData.length; i++)
      {
        strXML = strXML + "<set label='" + arrData[i][0]
            + "'    value='" + arrData[i][1] + "' />";
      }
      strXML = strXML + "</chart>";
      //String字符串流示例
      ChartUtils.outChartHTML(Constants.COLUMN3D, strXML,
          "myFirst", 600, 300, response);
    %>
  </BODY>
</HTML>

Tags:Flash 图表 FusionChartsV

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接