研究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>
?