- 浏览: 953640 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
u014408122:
...
2013.09.05——— android 蓝牙聊天室之官方例子 -
ChangHuiYuanH:
2011.10.10——— android 画图之setXfermode -
lipeng88213:
wenjiefeng 写道第一次无法向左滑动嗯 估计应该也没人 ...
2014.04.21(2)——— android开发实例之viewpager无限循环+自动滚动 (修改版) -
wenjiefeng:
第一次无法向左滑动
2014.04.21(2)——— android开发实例之viewpager无限循环+自动滚动 (修改版) -
beijibingshan2012:
lipeng88213 写道beijibingshan2012 ...
2010.07.23——— 用jstree作权限
2010.04.08(2)———FusionChartsFree与google map结合
把前一段时间的技术研究整合一下
=========================
sql.txt
===========================
2:在施工
3:停工
4:施工完毕
5:竣工
pojo
dao
service
control
jsp
主页面
统计图一
统计图二
spring.xml
web.xml
把前一段时间的技术研究整合一下
=========================
sql.txt
===========================
create table cp_gongcheng ( id varchar2(6) primary key, xm_name varchar2(50) not null, kg_date date, jianshe_name varchar2(50), jianshe_address varchar2(50), price varchar2(10), sheji_name varchar2(50), shigong_name varchar2(50), jianli_name varchar2(50), lat varchar2(50), lng varchar2(50), state number(1) );1:未开工
2:在施工
3:停工
4:施工完毕
5:竣工
insert into cp_gongcheng values(1,'昌平1',to_date('2008-01-01','yyyy-MM-dd'),'建设单位1','中关村1','200','设计单位1','施工单位1','监理单位1','116.17360688694838','39.92628655170422',5); insert into cp_gongcheng values(2,'昌平2',to_date('2008-02-01','yyyy-MM-dd'),'建设单位1','中关村1','11','设计单位1','施工单位9','监理单位10','116.19154675948158','39.936654868959835',1); insert into cp_gongcheng values(3,'昌平3',to_date('2008-03-01','yyyy-MM-dd'),'建设单位1','中关村1','14','设计单位2','施工单位1','监理单位7','116.25111269999108','39.81004604992633',2); insert into cp_gongcheng values(4,'昌平4',to_date('2008-04-01','yyyy-MM-dd'),'建设单位1','中关村1','24','设计单位1','施工单位10','监理单位1','116.2518007437151','39.85196938627968',3); insert into cp_gongcheng values(5,'昌平5',to_date('2008-05-01','yyyy-MM-dd'),'建设单位1','中关村1','34','设计单位1','施工单位1','监理单位1','116.28418833397541','39.913957636339',4); insert into cp_gongcheng values(6,'昌平6',to_date('2008-06-01','yyyy-MM-dd'),'建设单位1','中关村1','209','设计单位3','施工单位3','监理单位2','116.3006460020154','39.92769637687159',5); insert into cp_gongcheng values(7,'昌平7',to_date('2008-07-01','yyyy-MM-dd'),'建设单位1','中关村1','99','设计单位1','施工单位1','监理单位1','116.3727354206359','39.965062934708705',5); insert into cp_gongcheng values(8,'昌平8',to_date('2008-08-01','yyyy-MM-dd'),'建设单位1','中关村1','87','设计单位4','施工单位5','监理单位1','116.39397496636869','39.9207483996377',4); insert into cp_gongcheng values(9,'昌平9',to_date('2008-09-01','yyyy-MM-dd'),'建设单位1','中关村1','72','设计单位1','施工单位1','监理单位3','116.40370712324074','39.8630946007578',3); insert into cp_gongcheng values(10,'昌平10',to_date('2008-10-01','yyyy-MM-dd'),'建设单位2','中关村2','232','设计单位5','施工单位1','监理单位10','116.35569028814889','39.77388369133985',2); insert into cp_gongcheng values(11,'昌平11',to_date('2008-11-01','yyyy-MM-dd'),'建设单位2','中关村2','543','设计单位4','施工单位7','监理单位9','116.4503250773406','39.784154100740324',1); insert into cp_gongcheng values(12,'昌平12',to_date('2008-12-01','yyyy-MM-dd'),'建设单位2','中关村2','654','设计单位3','施工单位8','监理单位8','116.33219131866707','40.01347702262989',2); insert into cp_gongcheng values(13,'昌平13',to_date('2009-01-01','yyyy-MM-dd'),'建设单位2','中关村2','74','设计单位5','施工单位6','监理单位7','116.31838992225583','40.01978975974784',3); insert into cp_gongcheng values(14,'昌平14',to_date('2009-02-01','yyyy-MM-dd'),'建设单位2','中关村2','634','设计单位4','施工单位4','监理单位6','116.50403804974654','40.02365708949793',4); insert into cp_gongcheng values(15,'昌平15',to_date('2009-03-01','yyyy-MM-dd'),'建设单位2','中关村2','674','设计单位1','施工单位2','监理单位5','116.36212798576038','39.90009210327061',5); insert into cp_gongcheng values(16,'昌平16',to_date('2009-04-01','yyyy-MM-dd'),'建设单位2','中关村2','76','设计单位1','施工单位3','监理单位4','116.3145485587186','39.934305023916345',4); insert into cp_gongcheng values(17,'昌平17',to_date('2009-05-01','yyyy-MM-dd'),'建设单位2','中关村2','754','设计单位4','施工单位10','监理单位3','116.37008973318497','39.96111624061902',3); insert into cp_gongcheng values(18,'昌平18',to_date('2009-06-01','yyyy-MM-dd'),'建设单位2','中关村2','74','设计单位1','施工单位10','监理单位2','116.4058924927587','39.974716839707156',2); insert into cp_gongcheng values(19,'昌平19',to_date('2009-07-01','yyyy-MM-dd'),'建设单位2','中关村2','241','设计单位3','施工单位10','监理单位1','116.40674875677007','39.96464191775273',1); insert into cp_gongcheng values(20,'昌平20',to_date('2009-08-01','yyyy-MM-dd'),'建设单位3','中关村3','215','设计单位3','施工单位10','监理单位1','116.30998631667322','39.96078247674307',1); insert into cp_gongcheng values(21,'昌平21',to_date('2009-09-01','yyyy-MM-dd'),'建设单位3','中关村3','214','设计单位3','施工单位9','监理单位2','116.45167186710795','39.945192705638846',2); insert into cp_gongcheng values(22,'昌平22',to_date('2009-10-01','yyyy-MM-dd'),'建设单位3','中关村3','24','设计单位1','施工单位9','监理单位3','116.37491647349495','39.90217206981024',3); insert into cp_gongcheng values(23,'昌平23',to_date('2009-11-01','yyyy-MM-dd'),'建设单位3','中关村3','15','设计单位1','施工单位9','监理单位4','116.39470402016467','39.99101681726689',4); insert into cp_gongcheng values(24,'昌平24',to_date('2009-12-01','yyyy-MM-dd'),'建设单位3','中关村3','153','设计单位2','施工单位9','监理单位5','116.41518307281149','39.9981528934288',5); insert into cp_gongcheng values(25,'昌平25',to_date('2007-01-01','yyyy-MM-dd'),'建设单位3','中关村3','155','设计单位5','施工单位8','监理单位6','116.34191896608603','39.89848028801632',1); insert into cp_gongcheng values(26,'昌平26',to_date('2007-02-01','yyyy-MM-dd'),'建设单位3','中关村3','253','设计单位2','施工单位8','监理单位7','116.40041000733602','39.873802319171425',2); insert into cp_gongcheng values(27,'昌平27',to_date('2007-03-01','yyyy-MM-dd'),'建设单位3','中关村3','264','设计单位2','施工单位8','监理单位8','116.43905354867414','39.860974785225046',3); insert into cp_gongcheng values(28,'昌平28',to_date('2007-04-01','yyyy-MM-dd'),'建设单位3','中关村3','642','设计单位2','施工单位8','监理单位9','116.47888330072244','39.937891121169926',4); insert into cp_gongcheng values(29,'昌平29',to_date('2007-05-01','yyyy-MM-dd'),'建设单位3','中关村3','745','设计单位2','施工单位7','监理单位10','116.33998771456794','39.830685777542584',5); insert into cp_gongcheng values(30,'昌平30',to_date('2007-06-01','yyyy-MM-dd'),'建设单位4','中关村4','75','设计单位5','施工单位7','监理单位2','116.46833111487253','39.92864538095883',1); insert into cp_gongcheng values(31,'昌平31',to_date('2007-07-01','yyyy-MM-dd'),'建设单位4','中关村4','77','设计单位1','施工单位7','监理单位3','116.35306210540907','39.859914390635474',2); insert into cp_gongcheng values(32,'昌平32',to_date('2007-08-01','yyyy-MM-dd'),'建设单位4','中关村4','865','设计单位5','施工单位6','监理单位4','116.44678020949468','39.87071515334498',3); insert into cp_gongcheng values(33,'昌平33',to_date('2007-09-01','yyyy-MM-dd'),'建设单位4','中关村4','721','设计单位4','施工单位6','监理单位5','116.25847763376404','39.93552357842002',4); insert into cp_gongcheng values(34,'昌平34',to_date('2007-10-01','yyyy-MM-dd'),'建设单位4','中关村4','86','设计单位3','施工单位6','监理单位6','116.40536109372403','39.94286571966413',5); insert into cp_gongcheng values(35,'昌平35',to_date('2007-11-01','yyyy-MM-dd'),'建设单位4','中关村4','85','设计单位4','施工单位5','监理单位7','116.36080423476845','39.90073734499356',1); insert into cp_gongcheng values(36,'昌平36',to_date('2007-12-01','yyyy-MM-dd'),'建设单位4','中关村4','865','设计单位3','施工单位4','监理单位8','116.47759342923274','39.95135005205112',2); insert into cp_gongcheng values(37,'昌平37',to_date('2010-01-01','yyyy-MM-dd'),'建设单位4','中关村4','89','设计单位4','施工单位3','监理单位9','116.50176282772003','39.94386429634281',3); insert into cp_gongcheng values(38,'昌平38',to_date('2010-02-01','yyyy-MM-dd'),'建设单位4','中关村4','132','设计单位2','施工单位2','监理单位10','116.31787208953823','39.882617763295734',4); insert into cp_gongcheng values(39,'昌平39',to_date('2010-03-01','yyyy-MM-dd'),'建设单位4','中关村4','15','设计单位1','施工单位1','监理单位2','116.35053424574659','39.9635590021458',5); insert into cp_gongcheng values(40,'昌平40',to_date('2010-04-01','yyyy-MM-dd'),'建设单位5','中关村5','2645','设计单位1','施工单位6','监理单位5','116.32132235442673','39.975308233557584',1); insert into cp_gongcheng values(41,'昌平41',to_date('2010-05-01','yyyy-MM-dd'),'建设单位5','中关村5','765','设计单位1','施工单位5','监理单位4','116.48391594068349','40.00733633937471',2); insert into cp_gongcheng values(42,'昌平42',to_date('2010-06-01','yyyy-MM-dd'),'建设单位5','中关村5','2765','设计单位1','施工单位4','监理单位10','116.35269617586928','39.9070713025939',3); insert into cp_gongcheng values(43,'昌平43',to_date('2010-07-01','yyyy-MM-dd'),'建设单位5','中关村5','85','设计单位1','施工单位3','监理单位8','116.37511687393214','39.905807599264065',4); insert into cp_gongcheng values(44,'昌平44',to_date('2010-08-01','yyyy-MM-dd'),'建设单位5','中关村5','876','设计单位1','施工单位2','监理单位9','116.41821890783268','39.8841608896157',5); insert into cp_gongcheng values(45,'昌平45',to_date('2010-09-01','yyyy-MM-dd'),'建设单位5','中关村5','23','设计单位4','施工单位2','监理单位2','116.31422363159288','39.8733374354392',1); insert into cp_gongcheng values(46,'昌平46',to_date('2010-10-01','yyyy-MM-dd'),'建设单位5','中关村5','13','设计单位2','施工单位5','监理单位6','116.27853206612325','39.94398539017557',2); insert into cp_gongcheng values(47,'昌平47',to_date('2010-11-01','yyyy-MM-dd'),'建设单位5','中关村5','34','设计单位3','施工单位4','监理单位7','116.2974191939233','39.974813375703505',3); insert into cp_gongcheng values(48,'昌平48',to_date('2010-12-01','yyyy-MM-dd'),'建设单位5','中关村5','265','设计单位2','施工单位3','监理单位3','116.27924366300653纬','39.89252181319156',4); insert into cp_gongcheng values(49,'昌平49',to_date('2010-01-11','yyyy-MM-dd'),'建设单位5','中关村5','75','设计单位4','施工单位8','监理单位2','116.35905065495264','39.88296785914875',5); insert into cp_gongcheng values(50,'昌平50',to_date('2010-02-11','yyyy-MM-dd'),'建设单位1','中关村1','76','设计单位5','施工单位7','监理单位1','116.40243655503768','40.00711687073768',1);
pojo
package pojo; import java.util.Date; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="CP_GONGCHENG") public class CP_GongCheng { @Id private String id; private String xm_name; private Date kg_date; private String jianshe_name; private String jianshe_address; private String price; private String sheji_name; private String shigong_name; private String jianli_name; private String lat; private String lng; private int state; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getXm_name() { return xm_name; } public void setXm_name(String xm_name) { this.xm_name = xm_name; } public Date getKg_date() { return kg_date; } public void setKg_date(Date kg_date) { this.kg_date = kg_date; } public String getJianshe_name() { return jianshe_name; } public void setJianshe_name(String jianshe_name) { this.jianshe_name = jianshe_name; } public String getJianshe_address() { return jianshe_address; } public void setJianshe_address(String jianshe_address) { this.jianshe_address = jianshe_address; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } public String getSheji_name() { return sheji_name; } public void setSheji_name(String sheji_name) { this.sheji_name = sheji_name; } public String getShigong_name() { return shigong_name; } public void setShigong_name(String shigong_name) { this.shigong_name = shigong_name; } public String getJianli_name() { return jianli_name; } public void setJianli_name(String jianli_name) { this.jianli_name = jianli_name; } public String getLat() { return lat; } public void setLat(String lat) { this.lat = lat; } public String getLng() { return lng; } public void setLng(String lng) { this.lng = lng; } public int getState() { return state; } public void setState(int state) { this.state = state; } }
dao
package dao; import java.util.Date; import java.util.List; import org.apache.log4j.Logger; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; import pojo.CP_GongCheng; import util.MethodUtil; public class CP_GongChengDaoImp extends HibernateDaoSupport implements CP_GongChengDao{ // private HibernateTemplate hibernateTemplate; // // public HibernateTemplate getHibernateTemplate() { // return hibernateTemplate; // } // // public void setHibernateTemplate(HibernateTemplate hibernateTemplate) { // this.hibernateTemplate = hibernateTemplate; // } private static Logger log = Logger.getLogger(CP_GongChengDaoImp.class); public List<CP_GongCheng> getAll() { // TODO Auto-generated method stub String hql = "from CP_GongCheng"; log.info(hql); return (List<CP_GongCheng>)this.getHibernateTemplate().find(hql); } public List<CP_GongCheng> getByDate(Date start,Date end){ String hql = "from CP_GongCheng o where o.kg_date between ? and ?"; Object[] values = {start,end}; log.info("[ "+hql+" ] 参数是:[ "+MethodUtil.arrayToString(values)+" ]"); return (List<CP_GongCheng>)this.getHibernateTemplate().find(hql,values); } public void deleteById(String id){ log.info("删除id为"+id+"的点标注"); this.getHibernateTemplate().delete(this.getHibernateTemplate().get(CP_GongCheng.class, id)); } }
service
package service; import java.util.Date; import java.util.List; import org.apache.log4j.Logger; import pojo.CP_GongCheng; import pojo.Student; import dao.CP_GongChengDao; public class CP_GongChengServiceImp implements CP_GongChengService{ private static Logger log = Logger.getLogger(CP_GongChengServiceImp.class); private CP_GongChengDao CP_GongChengDao; public CP_GongChengDao getCP_GongChengDao() { return CP_GongChengDao; } public void setCP_GongChengDao(CP_GongChengDao CP_GongChengDao) { this.CP_GongChengDao = CP_GongChengDao; } public List<CP_GongCheng> findAll(){ return this.CP_GongChengDao.getAll(); } public List<CP_GongCheng> getByDate(Date start,Date end){ return this.CP_GongChengDao.getByDate(start, end); } public void deleteById(String id){ this.CP_GongChengDao.deleteById(id); } }
control
package control; import java.io.PrintWriter; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.json.JSONArray; import org.apache.log4j.Logger; import org.springframework.web.servlet.ModelAndView; import pojo.CP_GongCheng; import service.CP_GongChengService; public class CP_GongChengControl { private static Logger log = Logger.getLogger(CP_GongChengControl.class); private CP_GongChengService CP_GongChengService; public CP_GongChengService getCP_GongChengService() { return CP_GongChengService; } public void setCP_GongChengService(CP_GongChengService CP_GongChengService) { this.CP_GongChengService = CP_GongChengService; } public ModelAndView value(HttpServletRequest request, HttpServletResponse response) throws Exception { request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); List<CP_GongCheng> list = this.CP_GongChengService.findAll(); JSONArray json = JSONArray.fromObject(list); log.info(json.toString()); PrintWriter out = response.getWriter(); out.print(json.toString()); return null; } public ModelAndView fusionChart1(HttpServletRequest request,HttpServletResponse response) throws Exception{ request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); String date_07 = request.getParameter("date_07"); String date_08 = request.getParameter("date_08"); String date_09 = request.getParameter("date_09"); String date_10 = request.getParameter("date_10"); String[] colors = {"AFD8F8","F6BD0F","8BBA00","FF8E46","008E8E","008E8E","D64646","8E468E","588526","B3AA00","008ED6","9D080D","A186BE"}; // byte[] utf8Bom = new byte[]{(byte) 0xef, (byte) 0xbb, (byte) 0xbf}; // String utf8BomStr= new String(utf8Bom,"UTF-8");//定义BOM标记 String xml = "<?xml version='1.0' encoding='UTF-8' ?>" + "<graph numberSuffix='个' caption='各年份不同状态的项目数' xAxisName='施工状态' baseFont='宋体' baseFontSize='13' decimalPrecision='0' formatNumberScale='0'> " + "<categories font='宋体' fontSize='12' fontColor='000000'>"+ "<category name='未开工' />"+ "<category name='在建' />"+ "<category name='停工' />"+ "<category name='施工完毕' />"+ "<category name='竣工' />+" + "</categories>"; if(date_07.equals("true")){ xml +=getXml("20070101","20071231","2007",colors[0]); } if(date_08.equals("true")){ xml +=getXml("20080101","20081231","2008",colors[1]); } if(date_09.equals("true")){ xml +=getXml("20090101","20091231","2009",colors[2]); } if(date_10.equals("true")){ xml +=getXml("20100101","20101231","2010",colors[3]); } xml += "</graph>"; log.info(xml); PrintWriter out = response.getWriter(); out.print(xml); return null; } public ModelAndView fusionChart2(HttpServletRequest request,HttpServletResponse response) throws Exception{ request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); String year = request.getParameter("year"); String[] colors = {"AFD8F8","F6BD0F","8BBA00","FF8E46","008E8E","0F8ACE","D64646","8E468E","588526","B3AA00","008ED6","9D080D","A186BE","B2900F","FF1269","8DE128","30F25E"}; String xml = "<?xml version='1.0' encoding='UTF-8' ?>" + "<graph numberSuffix='万元' caption='"+year+"年各项目情况' xAxisName='项目' baseFont='宋体' baseFontSize='13' decimalPrecision='0' formatNumberScale='0'>"; // if(year.equals("2007")){ // xml += getXml("20070101","20071231",colors); // } // if(year.equals("2008")){ // xml +=getXml("20080101","20081231",colors); // } // if(year.equals("2009")){ // xml +=getXml("20090101","20091231",colors); // } // if(year.equals("2010")){ // xml +=getXml("20100101","20101231",colors); // } xml += getXml(year+"0101",year+"1231",colors); PrintWriter out = response.getWriter(); log.info(xml); out.print(xml); return null; } public ModelAndView control(HttpServletRequest request,HttpServletResponse response) throws Exception{ request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); String id = request.getParameter("id"); this.CP_GongChengService.deleteById(id); return null; } private String getXml(String st,String en,String[] colors) throws Exception{ Date start = new SimpleDateFormat("yyyyMMdd").parse(st); Date end = new SimpleDateFormat("yyyyMMdd").parse(en); List<CP_GongCheng> list = this.CP_GongChengService.getByDate(start, end); String xml = ""; for(int i=0;i<list.size();i++){ CP_GongCheng o = list.get(i); Date d = o.getKg_date(); String str = (d.getYear()+1900)+"年"+(d.getMonth()+1)+"月"+d.getDate()+"日"; xml += "<set name='"+o.getXm_name()+"' value='"+o.getPrice()+"' color='"+colors[i]+"' hoverText='"+o.getXm_name()+"项目,"+str+"申请' />"; } xml += "</graph>"; return xml; } private String getXml(String st,String en,String year,String color) throws Exception{ Date start = new SimpleDateFormat("yyyyMMdd").parse(st); Date end = new SimpleDateFormat("yyyyMMdd").parse(en); List<CP_GongCheng> list = this.CP_GongChengService.getByDate(start, end); int[] number = {0,0,0,0,0}; String xml = ""; for(CP_GongCheng o : list){ int state = o.getState(); switch(state){ case 1: number[0]++;break; case 2: number[1]++;break; case 3: number[2]++;break; case 4: number[3]++;break; case 5: number[4]++;break; } } for(int i=0;i<number.length;i++){ if(i==0){ xml += "<dataset seriesname='"+year+"' color='"+color+"'>"; } xml += "<set value='"+number[i]+"' />"; if(i==number.length-1){ xml += "</dataset>"; } } return xml; } }
jsp
主页面
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page isELIgnored="false" %> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>建设工程地图</title> <style type="text/css"> /*a { text-decoration: none;/*让下划线消失*/ } */ </style> <script type="text/javascript" src="http://ditu.google.cn/maps?file=api&v=2&key=ABQIAAAAMrMsJOafJ9iQiv3u_76UbBR8vkHRoFkNL20wl9TFwfiZ6y32rRRqIL6f0QOBg-HPknvlJxjNkrVUrA&sensor=true"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.3.2.js"></script> <script type="text/javascript"> //用于和后台的ajax请求 function fn5(start,number){ $.ajax({ type: "POST", url: "map_value.do", data: {start:start,number:number}, dataType: "json", success: function(data){ $.each(data,function(i,o){ $("#tr"+(i+1)+" td:eq(0)").text(o["id"]); $("#tr"+(i+1)+" td:eq(1)").text(o["name"]); $("#tr"+(i+1)+" td:eq(2)").text(o["age"]); }); } }); } function fn7(map,flat){ $.ajax({ type: "POST", url: "admin/map_value.do", dataType: "json", success: function(data){ $.each(data,function(i,o){ if(flat){ map.closeInfoWindow(); var state = o["state"]; var marker = new GMarker(new GLatLng(parseFloat(o["lng"]),parseFloat(o["lat"])),{ icon: createIcon(state)}); fillMarkers(state,marker); var date = new Date(parseInt(o["kg_date"]["time"])); //alert(date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()); map.addOverlay(marker); GEvent.addListener(marker,"click",function(latLng){ var str1 = "<div ><table border=\"2\" bordercolor=\"red\" cellspacing=\"0\" align=\"center\" ><tr><td colspan=\"2\" align=\"center\">"+o["xm_name"]+"</td></tr><tr><td>项目编号</td><td id=\"id\">"+o["id"]+"</td></tr><tr><td>项目名称</td><td>"+o["xm_name"]+"</td></tr><tr><td>开工时间</td><td>"+date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+"</td></tr><tr><td>建设单位名称</td><td>"+o["jianshe_name"]+"</td></tr><tr><td>建设单位地址</td><td>"+o["jianshe_address"]+"</td></tr><tr><td>设计单位</td><td>"+o["sheji_name"]+"</td></tr><tr><td>施工单位</td><td>"+o["shigong_name"]+"</td></tr><tr><td>监理单位</td><td>"+o["jianli_name"]+"</td></tr><tr><td>项目价格</td><td>"+o["price"]+"万元</td></tr><tr><td>项目状态</td><td>"+getNameByState(state)+"</td></tr><tr><td colspan=\"2\" align=\"center\"><input type=\"button\" value=\"新建\" id=\"new\" /> <input type=\"button\" value=\"修改\" id=\"change\"/> <input type=\"button\" value=\"删除\" id=\"remove\" onclick=\"remove()\"/></td></tr></table></div>"; var str2 = "<a href=\"admin/chart1.jsp\" target=\"new\">统计图分析1</a><br /><a href=\"admin/chart2.jsp\" target=\"blank\">统计图分析2</a>"; marker.openInfoWindowTabsHtml([new GInfoWindowTab("工地详细信息", str1),new GInfoWindowTab("统计信息",str2)] ); }); } }); } }); } var markers1 = []; var markers2 = []; var markers3 = []; var markers4 = []; var markers5 = []; function fillMarkers(flat,marker){ if(flat==1){ markers1.push(marker); }else if(flat==2){ markers2.push(marker); }else if(flat==3){ markers3.push(marker); }else if(flat==4){ markers4.push(marker); }else if(flat==5){ markers5.push(marker); } } function createIcon(flat){ var ico; if(flat==1){ ico = new GIcon(G_DEFAULT_ICON, 'images/yellow.png'); }else if(flat==2){ ico = new GIcon(G_DEFAULT_ICON, 'images/green.png'); }else if(flat==3){ ico = new GIcon(G_DEFAULT_ICON, 'images/red.png'); }else if(flat==4){ ico = new GIcon(G_DEFAULT_ICON, 'images/blue.png'); }else if(flat==5){ ico = new GIcon(G_DEFAULT_ICON, 'images/purple.png'); } return ico; } function getNameByState(flat){ var name; if(flat==1){ name = "未开工"; }else if(flat==2){ name = "在施工"; }else if(flat==3){ name = "停工"; }else if(flat==4){ name = "施工完毕"; }else if(flat==5){ name = "竣工"; } return name; } function controlColor(){ $(":checkbox").click(function(event){ var flat = parseInt(event.target.value); if(flat==1){ for(var i=0;i<markers1.length;i++){ if(markers1[i].isHidden()){ markers1[i].show(); }else{ markers1[i].hide(); } } }else if(flat==2){ for(var i=0;i<markers2.length;i++){ if(markers2[i].isHidden()){ markers2[i].show(); }else{ markers2[i].hide(); } } }else if(flat==3){ for(var i=0;i<markers3.length;i++){ if(markers3[i].isHidden()){ markers3[i].show(); }else{ markers3[i].hide(); } } }else if(flat==4){ for(var i=0;i<markers4.length;i++){ if(markers4[i].isHidden()){ markers4[i].show(); }else{ markers4[i].hide(); } } }else if(flat==5){ for(var i=0;i<markers5.length;i++){ if(markers5[i].isHidden()){ markers5[i].show(); }else{ markers5[i].hide(); } } } }); } function controlData(){ $("#remove").click(function(){ remove(); }); } function remove(){ //alert($("#id").text()); if(window.confirm("确定要删除此标注?")){ $.get("admin/map_control.do",{id:$("#id").text()}); //window.location.reload();//全屏刷新 map.clearOverlays(); fn7(map,true); } } var map ; $(function(){ if(GBrowserIsCompatible()){//判断浏览器兼容性 map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(39.9076,116.3397),10); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.enableScrollWheelZoom(); fn7(map,true); controlColor(); //controlData(); //var str1 = "<div style=\"width:200px; height:220px;\"><table border=\"2\" bordercolor=\"red\" cellspacing=\"0\" align=\"center\" ><tr><td colspan=\"3\" align=\"center\">人工岛工程</td></tr><tr><td>ID</td><td>名字</td><td>年龄</td></tr><tr id=\"tr1\"><td></td><td></td><td></td></tr><tr id=\"tr2\"><td></td><td></td><td></td></tr><tr id=\"tr3\"><td></td><td></td><td></td></tr><tr id=\"tr4\"><td></td><td></td><td></td></tr><tr align=\"center\"><td colspan=\"3\"><input type=\"button\" value=\"上一页\" onclick=\"\" /> <input type=\"button\" value=\"下一页\" onclick=\"\"/></td></tr></table></div>"; //var str2 = "<select><option>北京</option><option>天津</option><option>河北</option></select>"; //var marker = new GMarker(map.getCenter(),{title:"呵呵"}); //map.addOverlay(marker); //GEvent.addListener(marker,"click",function(latLng){ //var str3 = "经度: "+latLng.lng()+",纬度: "+latLng.lat(); //marker.openInfoWindowTabsHtml([new GInfoWindowTab("标签一", str1),new GInfoWindowTab("标签二", str3)] ); //fn5(0,4); //}); } $(window).unload(function(){ GUnload(); }) }); </script> </head> <body> <div id="map_canvas" style="height:500px;"></div> <table border="1" bgcolor="FFFFFF" bordercolor="black" cellspacing="0" style="position:absolute;top:40;right:15;"> <tr align="center"><td colspan="2">工程状态</td></tr> <tr><td><input type="checkbox" name="checkbox" id="checkbox1" value="1" checked="checked"/></td><td><img src="images/yellow.png"/> 未开工</td></tr> <tr><td><input type="checkbox" name="checkbox" id="checkbox2" value="2" checked="checked"/></td><td><img src="images/green.png"/> 在施工</td></tr> <tr><td><input type="checkbox" name="checkbox" id="checkbox3" value="3" checked="checked"/></td><td><img src="images/red.png"/> 停工</td></tr> <tr><td><input type="checkbox" name="checkbox" id="checkbox4" value="4" checked="checked"/></td><td><img src="images/blue.png"/> 施工完毕</td></tr> <tr><td><input type="checkbox" name="checkbox" id="checkbox5" value="5" checked="checked"/></td><td><img src="images/purple.png"/> 竣工</td></tr> </table> </body> </html>
统计图一
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page isELIgnored="false" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>建筑工程统计图 </title> <script type="text/javascript" src="${pageContext.request.contextPath}/FusionCharts/FusionCharts.js"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.3.2.js"></script> <script type="text/javascript"> var xml = ""; var pic = "${pageContext.request.contextPath}/FusionCharts/FCF_MSColumn3D.swf"; function ajax(value1,value2,value3,value4,type){ $.ajax({ type: "post", url: "map_chart1.do", data: {date_07:value1,date_08:value2,date_09:value3,date_10:value4}, dataType: "text", success: function(data){ xml = data; updateChart(type); } }); } $(window).ajaxStart(function(){ $("#loading").show(); }); $(window).ajaxStop(function(){ $("#loading").hide(); }); function updateChart(chartSWF){ //Create another instance of the chart. var chart = new FusionCharts(chartSWF, "chart1Id", "600", "350", "0", "0"); chart.setDataXML(xml); chart.render("chartDiv"); } $(function(){ ajax("true","true","true","true",pic); for(var i=7;i<11;i++){ var temp ; if(i<10){ temp = "0"+i }else{ temp = i+""; } $("#date_"+temp).click(function(){ ajax($("#date_07").is(":checked"),$("#date_08").is(":checked"),$("#date_09").is(":checked"),$("#date_10").is(":checked"),pic); //判断复选框至少要选一项 if($("[name=checkbox1]:checkbox:checked").length==1){ $("[name=checkbox1]:checkbox:checked").attr("disabled","disabled"); }else{ $("[name=checkbox1]:checkbox:checked").removeAttr("disabled"); } }); } for(var i=1;i<10;i++){ $("#bn"+i).click(function(event){ pic = event.target.name; updateChart(pic); }); } }); </script> </head> <body bgcolor="#ffffff" > <form name='frmUpdate'> 展现方式: <input id="bn1" type='button' value='3D柱状图' name='../FusionCharts/FCF_MSColumn3D.swf' /> <input id="bn2" type='button' value='2D柱状图' name='../FusionCharts/FCF_MSColumn2D.swf' /> <input id="bn3" type='button' value='折线图' name='../FusionCharts/FCF_MSLine.swf' /> <input id="bn4" type='button' value='2D面积图' name='../FusionCharts/FCF_MSArea2D.swf' /> <input id="bn5" type='button' value='2D横向柱状图' name='../FusionCharts/FCF_MSBar2D.swf' /> <input id="bn6" type='button' value='面积堆栈图' name='../FusionCharts/FCF_StackedArea2D.swf' /> <input id="bn7" type='button' value='横向柱状堆栈图' name='../FusionCharts/FCF_StackedBar2D.swf' /> <input id="bn8" type='button' value='2D柱状堆栈图' name='../FusionCharts/FCF_StackedColumn2D.swf' /> <input id="bn9" type='button' value='3D柱状堆栈图' name='../FusionCharts/FCF_StackedColumn3D.swf' /> </form> <div id="chartDiv" align="center"><div id="loading"><img src='../images/loading.gif' /></div></div> 数据显示:<input name="checkbox1" type="checkbox" value="date_07" id="date_07" checked="checked"/> 2007 <input name="checkbox1" type="checkbox" value="date_08" id="date_08" checked="checked"/> 2008 <input name="checkbox1" type="checkbox" value="date_09" id="date_09" checked="checked"/> 2009 <input name="checkbox1" type="checkbox" value="date_10" id="date_10" checked="checked"/> 2010 </body> </html>
统计图二
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page isELIgnored="false" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>动态类型改变 </title> <script type="text/javascript" src="${pageContext.request.contextPath}/FusionCharts/FusionCharts.js"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.3.2.js"></script> <script type="text/javascript"> var xml = ""; var pic = "../FusionCharts/FCF_Column3D.swf"; function ajax(value,type){ $.ajax({ type: "post", url: "map_chart2.do", data: {year:value}, dataType: "text", success: function(data){ xml = data; updateChart(type); } }); } $(window).ajaxStart(function(){ $("#loading").show(); }); $(window).ajaxStop(function(){ $("#loading").hide(); }); function updateChart(chartSWF){ //Create another instance of the chart. var chart = new FusionCharts(chartSWF, "chart1Id", "800", "350", "0", "0"); //alert(xml); chart.setDataXML(xml); chart.render("chartDiv"); } $(function(){ ajax("2007",pic); for(var i=8;i<12;i++){ $("#bn"+i).click(function(event){ ajax(event.target.value,pic); }); } for(var i=1;i<8;i++){ $("#bn"+i).click(function(event){ pic = event.target.name; updateChart(pic); }); } }); </script> </head> <body bgcolor="#ffffff"> <form name='frmUpdate'> 展现方式: <input id="bn1" type='button' value='柱状图' name='../FusionCharts/FCF_Column3D.swf' /> <input id="bn2" type='button' value='折线图' name='../FusionCharts/FCF_Line.swf'/> <input id="bn3" type='button' value='饼状图' name='../FusionCharts/FCF_Pie2D.swf' /> <input id="bn4" type='button' value='面积图' name='../FusionCharts/FCF_Area2D.swf' /> <input id="bn5" type='button' value='横向柱状图' name='../FusionCharts/FCF_Bar2D.swf' /> <input id="bn6" type='button' value='圆圈图' name='../FusionCharts/FCF_Doughnut2D.swf' /> <input id="bn7" type='button' value='锥状图' name='../FusionCharts/FCF_Funnel.swf' /> </form> <div id="chartDiv" align="center"><div id="loading"><img src='../images/loading.gif' /></div></div> 时间: <input id="bn8" type="button" value="2007" /> <input id="bn9" type="button" value="2008" /> <input id="bn10" type="button" value="2009" /> <input id="bn11" type="button" value="2010" /> </body> </html>
spring.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd" default-autowire="byName"> <!-- <aop:aspectj-autoproxy proxy-target-class="true"/> --> <!-- 数据库外部文件配置 --> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list><value>classpath:db.properties</value></list> </property> <property name="fileEncoding" value="utf-8" /> </bean> <!-- 数据库外部文件配置 --> <!-- 配置数据源 使用dbcp数据源 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="${jdbc.driverClassName}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> </bean> <!-- 配置数据源 使用dbcp数据源 --> <!-- Hibernate SessionFactory配置 --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="annotatedClasses"> <list> <value>pojo.CP_GongCheng</value> <value>pojo.User</value> <value>pojo.Group</value> <value>pojo.Action</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.Oracle9Dialect </prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">true</prop> <prop key="hibernate.use_sql_comments">true</prop> </props> </property> </bean> <!-- Hibernate SessionFactory配置 --> <!-- hibernateTemplate --> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!-- hibernateTemplate --> <!-- dao --> <bean id="CP_GongChengDao" class="dao.CP_GongChengDaoImp" > <!-- <property name="hibernateTemplate"> <ref bean="hibernateTemplate" /> </property> --> </bean> <bean id="userDao" class="dao.UserDaoImp"> </bean> <bean id="actionDao" class="dao.ActionDaoImp"> </bean> <!-- dao --> <!-- serice --> <bean id="CP_GongChengService" class="service.CP_GongChengServiceImp" > <property name="CP_GongChengDao" > <ref bean="CP_GongChengDao" /> </property> </bean> <bean id="userService" class="service.UserServiceImp"> <property name="userDao"> <ref bean="userDao" /> </property> </bean> <!-- serice --> <!-- spring MVC --> <bean id="CP_GongChengDelegate" class="control.CP_GongChengControl"> <property name="CP_GongChengService"><ref bean="CP_GongChengService"/></property> </bean> <bean id="CP_GongChengController" class="org.springframework.web.servlet.mvc.multiaction.MultiActionController"> <property name="methodNameResolver" ref="propMethodNameResolver"/> <property name="delegate" ref="CP_GongChengDelegate"/> </bean> <bean id="userDelegate" class="control.UserControl"> <property name="userService"><ref bean="userService"/></property> </bean> <bean id="userController" class="org.springframework.web.servlet.mvc.multiaction.MultiActionController"> <property name="methodNameResolver" ref="propMethodNameResolver"/> <property name="delegate" ref="userDelegate"/> </bean> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/admin/map_*.do">CP_GongChengController</prop> <prop key="/user_*.do">userController</prop> </props> </property> </bean> <bean id="propMethodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver"> <property name="mappings"> <props> <prop key="/admin/map_value.do">value</prop> <prop key="/admin/map_chart1.do">fusionChart1</prop> <prop key="/admin/map_chart2.do">fusionChart2</prop> <prop key="/admin/map_control.do">control</prop> <prop key="/user_login.do">login</prop> </props> </property> </bean> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property> <property name="prefix"><value></value></property> <property name="suffix"><value>.jsp</value></property> <property name="contentType"><value>text/html;charset=utf-8</value></property> </bean> <!-- spring MVC --> </beans>
web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>WEB-INF/classes/log4j.xml</param-value> </context-param> <servlet> <servlet-name>DispatcherServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>DispatcherServlet</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> </web-app>
相关推荐
2. **Examples**:这里包含了一系列的示例代码,展示了如何使用FusionCharts Free创建各种图表,对初学者来说非常有帮助,可以通过查看和修改这些例子来快速上手。 3. **Documentation**:文档部分提供了详细的API...
2. **基本图表类型**:介绍各种图表,如柱状图、饼图、线图、面积图、散点图等,每个图表都有其特定的用途和应用场景,文档会说明它们的特点和配置选项。 3. **数据源**:FusionCharts支持XML、JSON、CSV等多种数据...
例如,柱状图适用于比较各类别的数值,饼图则能直观地展示部分与整体的关系,而区域图和趋势图则能清晰展示数据随时间的变化趋势。 其次,FusionCharts Free的一大亮点是其3D效果。这种视觉呈现方式可以为图表增添...
标题"FusionChartsFree"指的是一个免费的图表库,它与Web开发中的数据可视化有关。FusionCharts是一款JavaScript图表库,可以生成丰富的互动图表,适用于多种编程语言,包括JSP(JavaServer Pages)。在"Ext+...
2. 图表配置:接着,利用FusionCharts的API和丰富的配置选项,设置图表类型、颜色、标签、动画效果等,定制符合需求的报表样式。 3. 代码集成:将配置好的图表代码嵌入到你的网页或应用程序中,FusionCharts会自动...
2. **创建图表对象**:使用JavaScript创建FusionCharts对象,需要指定图表类型(如饼图、柱状图、线图等)、宽度、高度以及数据源。 ```javascript var myChart = new FusionCharts("Column2D", "myChartId", ...
这使得无论你使用哪种后端技术,都能轻松集成FusionCharts,实现动态数据与图表的完美结合。同时,FusionCharts提供了丰富的示例代码库,帮助开发者快速理解和应用到实际项目中。 **饼图** 是一种常用于展示各部分...
2. **数据格式**:FusionCharts支持XML、JSON、CSV等多种数据格式,使得数据集成变得简单。开发者可以根据项目需求选择最适合的数据输入方式。 3. **交互性**:FusionCharts的图表是动态的,用户可以进行点击、缩放...
相信很多做图表的朋友都听说过FusionChartsFree,再不学习你就out了,它的功能十分强大,本资源包括FusionChartsFreeAPI,相关的很多资料文档,教程,解决方案,帮助手册,参数大全等等。
2. **基本配置**:学习设置图表的基本属性,如图表ID、宽度、高度、标题、副标题、图例位置等。这些属性可以通过JavaScript对象进行定义,以便自定义图表的外观和布局。 3. **数据源**:理解如何为图表提供数据。...
使用FusionCharts Free,开发者可以轻松地将数据转换为动态图表,支持XML、JSON等多种数据格式,便于与后端数据接口对接。控件支持多种图表类型的创建,包括但不限于条形图、折线图、饼图、散点图等,还支持自定义...
2. `详细文档.pdf`:相同的文档,但格式为PDF,方便在不同设备上阅读或打印。PDF版本通常会保持原文档的排版,方便离线查阅。 使用FusionCharts Free制作图表时,首先需要在HTML页面中引入相关的JavaScript库文件,...