首页>代码>Java版ECharts图表库ECharts-Java的使用(基于springmvc)>/echarts/src/main/java/com/cn/stephen/echarts/controller/EchartController.java
package com.cn.stephen.echarts.controller; import org.springframework.beans.factory.annotation.Autowired; 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.cn.stephen.echarts.model.WebResult; import com.cn.stephen.echarts.service.ChartService; import com.github.abel533.echarts.Option; @Controller @RequestMapping("/echarts") public class EchartController { @Autowired private ChartService chartService; @RequestMapping("/home") public String home(){ return "home"; } @RequestMapping("/charts") public ModelAndView charts(){ ModelAndView modelAndView=new ModelAndView(); modelAndView.setViewName("main"); return modelAndView; } @ResponseBody @RequestMapping("/barChart") public WebResult queryBarChart() { WebResult result = new WebResult(); Option option = chartService.getBarChart(false); result.setData(option); return result; } }

sxslbjgwzh LV2
2023年8月21日
lipiao161 LV16
2023年2月27日
wusiyin LV14
2022年9月15日
weijianguo LV7
2021年11月20日
zwt689 LV2
2021年6月23日
xcj456 LV8
2020年9月12日
hohhi LV6
2020年6月22日
kk53902500 LV11
2020年3月23日
qq986549933 LV7
2019年11月11日
caozongan LV19
2019年9月26日