后台代码:
Map
map.put("一月标", 12);
map.put("六月标", 4);
map.put("三月标", 9);
List
List
Iterator it = map.keySet().iterator();
while(it.hasNext()){
String key=(String) it.next();
nameList.add(key);
valueList.add(map.get(key));
}
request.setAttribute("nameList", JSONArray.fromObject(nameList).toString());
request.setAttribute("valueList",JSONArray.fromObject(valueList).toString());
}
前台:
data:[
{
name:${nameList},
value:${valueList}
}
]