Google Vizualization with CSV data

Posted by Shlomo Shmai on Stack Overflow See other posts from Stack Overflow or by Shlomo Shmai
Published on 2010-03-24T00:59:21Z Indexed on 2010/03/24 1:03 UTC
Read the original article Hit count: 327

Filed under:
|
|
|
|

Hi,

I have a URL that returns data in CSV format. I would like to use Google Vizualization to create an interactive chart of the data. I've looked at several examples on Google Chart and Vizualization web page but I'm a bit confused as I'm not familiar with JavaScript or web programming in general.

Question: Do I have to use JavaScript to parse the CSV string myself and manually construct the DataTable with addColumn() and addRows()? Or, is there a way to simply pass the CSV url to the charting function? I'm hoping to do something like this:

var csv_data = get_data_from_url('http://...')
var data = new google.visualization.DataTable(csv_data);
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, ...);

Can someone please help me out?

Thanks.

© Stack Overflow or respective owner

Related posts about csv

Related posts about chart