Re: Best way to retrieve json file and create column chart and data table

304 views
Skip to first unread message

Yolanda Davis

unread,
Aug 14, 2012, 10:26:35 AM8/14/12
to google-visua...@googlegroups.com
Tracy,

I think you can accomplish this all with jQuery and the Google Datatable/DataView.  If you are using a file to store the JSON you can save it as a php file and then use jQuery ajax to read the contents of that php file into a DataTable.  From there you can use the group method in order to do aggregate functions (sum, average, etc).  Finally you can pass that into your column chart.

I hope this helps! Here is the online reference to the group method:  https://developers.google.com/chart/interactive/docs/reference#google_visualization_data_group 

Yolanda

On Monday, August 13, 2012 6:24:42 PM UTC-4, Tracy Ridge wrote:
Hi

I am just requiring a little advice on how to approach this project.
I am going to place all my data in a json file.  The data is a list of donations categorised by individual, company, school and miscellaneous donations.

I want to make a column chart with the total(sum) of all donations from each categories and a table with the top 10 donations from the categories with the names and amount.

I would prefer to do this with PHP but if easier will use jQuery and I would also like to take in consideration any security issues.  Any help will be gratefully appreciated.

Thanks in advance

Tracy

Tracy Ridge

unread,
Aug 14, 2012, 11:27:54 AM8/14/12
to google-visua...@googlegroups.com
Thanks Yolanda

This is really useful.  Out of interest can you take data from a google spreadsheet and manipulate it.  I wondered whether retrieving the information form a google spreadsheet would be better.

asgallant

unread,
Aug 14, 2012, 12:23:50 PM8/14/12
to google-visua...@googlegroups.com
Yes, you can fetch data from a Google spreadsheet, and once it's in the client's browser, you can do anything you like with it.  I don't think you will want that, though, as the spreadsheet has to be made public in order to query it.

Yolanda Davis

unread,
Aug 14, 2012, 12:35:41 PM8/14/12
to google-visua...@googlegroups.com
Yes you can use a google spreadsheet. I haven't done it but here's the info on it:  https://developers.google.com/chart/interactive/docs/spreadsheets#Google_Spreadsheets_as_a_Data_Source 



--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/Hw9Lg9XZDGAJ.

To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

Tracy Ridge

unread,
Aug 14, 2012, 3:24:42 PM8/14/12
to google-visua...@googlegroups.com
Good point
Reply all
Reply to author
Forward
0 new messages