import grails.converters.JSON class VisualizationController { def index = { } def test = { } // Voir http://code.google.com/apis/visualization/documentation/reference.html#DataTable // et http://code.google.com/apis/visualization/documentation/dev/implementing_data_source.html def data = { def table = [ cols: [ [id: 'task', label: 'Task', type: 'string'], [id: 'hours', label: 'Hours_per_Day', type: 'number'] ], rows: [ [c:[[v: 'Work'], [v: 11]]], [c:[[v: 'Eat'], [v: 2]]], [c:[[v: 'Commute'], [v: 2, f: '2.000']]] ] ] def response = [version: '0.5', status:'ok', table: table] render response as JSON } }