Rohit Singh
unread,May 12, 2012, 5:51:13 AM5/12/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Chart API
Hi All,
I am querying DB and populating Products in an arraylist then i am
converting them to JsonArray
here is a snippet
ArrayList<ProductTest> list= pimpl.getProductList(productId,
startDate, endDate);
Gson gson = new Gson();
String json = gson.toJson(list);
JsonParser parser = new JsonParser();
JsonArray array = parser.parse(json).getAsJsonArray();
on client side (JSP) i am trying to pass this array to datatable
var data = new google.visualization.DataTable(<%=array%>);
it is giving no table no columns however the array prints
[{"product_id":0,"unique_visitors":9237},{"product_id":
1,"unique_visitors":237},{"product_id":2,"unique_visitors":3000},
{"product_id":3,"unique_visitors":3000},{"product_id":
4,"unique_visitors":3000}] on console is there anything wrong in this
code ?
Please help