資源簡介
使用ssm基于jsp頁面整合了echarts,適合初學(xué)者學(xué)習(xí)。。

代碼片段和文件信息
package?com.controller;
import?java.util.ArrayList;
import?java.util.HashMap;
import?java.util.List;
import?java.util.Map;
import?javax.annotation.Resource;
import?org.springframework.stereotype.Controller;
import?org.springframework.web.bind.annotation.RequestMapping;
import?org.springframework.web.bind.annotation.ResponseBody;
import?org.springframework.web.servlet.ModelAndView;
import?com.alibaba.fastjson.JSONobject;
import?com.entity.Emp;
import?com.entity.EmpCount;
import?com.entity.PieGraph;
import?com.service.AjaxService;
@Controller
public?class?AjaxController?{
@Resource
private?AjaxService?ajaxservice;
//柱狀圖
@RequestMapping(value=“/getcount3“?produces=“application/json;charset=utf-8“)
//欲傳兩個(gè)list到頁面,使用@ResponseBody將String轉(zhuǎn)化為json數(shù)組
public?@ResponseBody?String?getCount3()?{
List?list?=?ajaxservice.getEmpCount();
List?deptlist?=?new?ArrayList();
List?countlist?=?new?ArrayList();
for?(EmpCount?ec?:?list)?{
deptlist.add(“部門“+ec.getDeptno());
countlist.add(ec.getEmpcount());
}
//拆分成兩個(gè)list以輸出柱狀圖
JSONobject?obj?=?new?JSONobject();
obj.put(“deptlist“?deptlist);
obj.put(“countlist“?countlist);
return?obj.toJSONString();
}
//餅狀圖
@RequestMapping(“/getcount4“)
public?@ResponseBody?List?getCount4()?{
List?list?=?ajaxservice.getEmpCount();
//對(duì)list進(jìn)行處理,以輸出餅狀圖
List?newlist?=?new?ArrayList();
for?(EmpCount?ec?:?list)?{
PieGraph?pg?=?new?PieGraph(“部門“+ec.getDeptno()?ec.getEmpcount());
newlist.add(pg);
}
return?newlist;
}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????1380??2018-09-30?09:12??echarts\.classpath
?????文件???????1540??2018-09-30?09:12??echarts\.project
?????文件????????522??2018-09-30?09:12??echarts\.settings\.jsdtscope
?????文件????????125??2018-09-30?09:12??echarts\.settings\com.genuitec.eclipse.core.prefs
?????文件????????108??2018-09-30?09:12??echarts\.settings\com.genuitec.runtime.libraries.xm
?????文件????????364??2018-09-30?09:12??echarts\.settings\org.eclipse.jdt.core.prefs
?????文件????????480??2018-09-30?09:12??echarts\.settings\org.eclipse.wst.common.component
?????文件????????588??2018-09-30?09:12??echarts\.settings\org.eclipse.wst.common.project.facet.core.prefs.xm
?????文件????????462??2018-09-30?09:12??echarts\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件?????????49??2018-09-30?09:12??echarts\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件??????????6??2018-09-30?09:12??echarts\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件????????425??2018-09-30?09:12??echarts\.springBeans
?????文件???????3584??2018-09-30?09:12??echarts\src\applicationContext.xm
?????文件???????1699??2018-09-30?09:12??echarts\src\com\controller\AjaxController.java
?????文件????????869??2018-09-30?09:12??echarts\src\com\entity\Emp.java
?????文件????????540??2018-09-30?09:12??echarts\src\com\entity\EmpCount.java
?????文件????????518??2018-09-30?09:12??echarts\src\com\entity\PieGraph.java
?????文件????????151??2018-09-30?09:12??echarts\src\com\mapper\AjaxMapper.java
?????文件????????485??2018-09-30?09:12??echarts\src\com\mapper\AjaxMapper.xm
?????文件????????203??2018-09-30?09:12??echarts\src\com\service\AjaxService.java
?????文件????????450??2018-09-30?09:12??echarts\src\com\service\impl\AjaxServiceImpl.java
?????文件????????756??2018-09-30?09:12??echarts\src\log4j.properties
?????文件????????338??2018-09-30?09:12??echarts\src\mybatis-config.xm
?????文件???????2453??2018-09-30?09:12??echarts\WebRoot\BarGraph.jsp
?????文件????2341246??2018-09-30?09:12??echarts\WebRoot\js\echarts.js
?????文件??????84284??2018-09-30?09:12??echarts\WebRoot\js\jquery-2.1.1.min.js
?????文件?????????39??2018-09-30?09:12??echarts\WebRoot\me
?????文件???????3584??2018-09-30?09:12??echarts\WebRoot\WEB-INF\classes\applicationContext.xm
?????文件???????3278??2018-09-30?09:12??echarts\WebRoot\WEB-INF\classes\com\controller\AjaxController.class
?????文件???????1283??2018-09-30?09:12??echarts\WebRoot\WEB-INF\classes\com\entity\Emp.class
............此處省略43個(gè)文件信息
評(píng)論
共有 條評(píng)論