thymeleaf模板引擎div th:each=展示echarts图表

前台动态展示echarts图表,使用spring boot 与 thymeleaf

html页面

 

 

Onions
 


controller层

 

 

@RequestMapping(value = "pkhsx_all")
public List getChartDataPKHSXAll(ViewAllCommand viewAllCommand){
    List list = new ArrayList();
    EchartArrayList hc = new EchartArrayList();
    String territorycode = viewAllCommand.getTerritorycode();
   /// System.out.println(territorycode);
    List userBroswerList = analysisAllService.findChartview_PKHSH_ALl(territorycode);
    System.out.println(userBroswerList.get(0).getCounty());
    List lt = new ArrayList();
    List ltx = new ArrayList();
    List ltc = new ArrayList();
    hc = new EchartArrayList();
    hc.setName("贫困户属性");
    if (userBroswerList.size() > 0) {
        for (View_ccpkhsx obj : userBroswerList) {
            lt.add(obj.getNum());
            ltx.add(obj.getAAD107());
            ltc.add(obj.getCounty());
        }
    }
    hc.setData1(lt);
    hc.setData2(ltx);

    hc.setData3(ltc);
   // System.out.println(hc.getData3().toString());
    list.add(hc);
    return list;
} 
  

   更多计算机视频教程(Java、Python、大数据等等)、计算机软件(Mac)、影视资源推荐。

         欢迎大家关注本公众号:V的聚集地 

 

 

 

你可能感兴趣的:(spring,boot)