본문 바로가기
Work/jqcloud

cloudchart

by 승수 2020. 4. 6.


java 데이터 부분



List<Object> cloudChartListN = new ArrayList<Object>();


Map<String,Object> chartMap = new HashMap<String, Object>();

chartMap.put("text", childList.get(cnt).getLabel());

chartMap.put("weight", childList.get(cnt).getFrequency());


cloudChartListN.add(chartMap);


model.addAttribute("cloudChartListN", new Gson().toJson(cloudChartListN));



jsp 부분



function cloudChart() {


 var word_list = eval('${cloudChartListN}');

$("#wordCloudNT").jQCloud(word_list, {

  width: 235,

height: 100

});


}


<div id="wordCloudNT" style="height:100px; margin-top: 10px; "></div>