当前位置: 代码迷 >> Web前端 >> java应用amcharts
  详细解决方案

java应用amcharts

热度:107   发布时间:2012-09-10 11:02:33.0
java使用amcharts
研究amcharts 它的效果确实很好,而且官方网站上还有好些例子可供下载,网址是:www.amcharts.com 

<%@ page language="java" import="java.util.*"%>   
<%@ page contentType="text/xml; charset=utf-8"%>   
<jsp:directive.page import="org.web.entity.Stack"/>   
<%   
String path = request.getContextPath();   
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";   
%>   
<?xml version="1.0" encoding="UTF-8"?>   
<chart>   
<axes>   
<%   
    List<Stack> list=(List<Stack>)request.getSession().getAttribute("list");   
     for(int i=0;i<list.size();i++)   
     {   
        Stack s=list.get(i);   
   %>   
   <axis xid="<%=i%>"><%=s.getAxis()%></axis>   
   <%   
    }   
   %>   
</axes>   
<graphs>   
     <graph gid="1">   
    <%   
     for(int n=0;n<list.size();n++)   
     {   
        Stack ss=list.get(n);   
      %>   
    
  <value xid="<%=n%>"><%=ss.getShuju()%></value>    
   <%   
   }   
   %>   
   </graph>   
   <graph gid="2">    
   <%   
     for(int m=0;m<list.size();m++)   
     {   
        Stack ss=list.get(m);   
      %>   
   <value xid="<%=m%>"><%=ss.getShuju1()%></value>   
  <%   
      }   
  %>   
  </graph>   
</graphs>   
</chart>  

?

  相关解决方案