日期:2014-05-18  浏览次数:20639 次

JSONObject 的问题
前台要的数据是
['Firefox',   45.0],
 ['IE',       26.8],
['Safari',    8.5],
['Opera',     6.2],
 ['Others',   0.7]
这样的后台action 返回的json如何写啊    我在用highcharts做统计

------解决方案--------------------

JSONObject jsonResult = new JSONObject();
jsonResult.put("Firefox", 45.0);
jsonResult.put("IE", 26.8);
jsonResult.put("Safari", 8.5);
jsonResult.put("Opera", 6.2);
jsonResult.put("Others", 0.7);
actionResult = jsonResult.toString();