使用SpringMVC、Echarts绘制柱状图:

前提用Maven搭好springMVC的框架
1、建一个jsp页面,代码如下:

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>




Insert title here




2、controller那边的代码:

@Controller
public class GradeController {
	@RequestMapping("/getGrade")
	@ResponseBody
	public List showGradeName(){
		List list=new ArrayList();
		list.add(new Grade("一班","89.9"));
		list.add(new Grade("二班","90.0"));
		list.add(new Grade("三班","67.9"));
		list.add(new Grade("四班","89.9"));
		list.add(new Grade("五班","70.0"));
		list.add(new Grade("六班","67.9"));
		return list;		
	}
}

3、测试结果:
使用SpringMVC、Echarts绘制柱状图:_第1张图片

你可能感兴趣的:(springmvc)