grails - How to render Json data which is Needed -
[ {name: "name1", y: val1}, {name: "name2", y: val2}, {name: "name3", y: val3}, ..., {name: "namen", y: valn} ]
i value in json
format
how use this format in piechart
in grails
?
just put values in hash , use render json.
def getorganizationgroups() { def result = grouptype.findall().sort({it.sortorder}).collect() { [ code: it.grouptypecode, name: it.displayname, sort: it.sortorder ] } render(result json) }
Comments
Post a Comment