Question : json to javascript - google charts

Dear Experts,

I have an serverside file "get_json.aspx", which simply returns a string in the form of json data:

1:
2:
3:
4:
5:
['user 1',{v:84.27, f:'£150923.60'}],
['user 2, K',{v:3.24, f:'£5801.00'}],
['user 3',{v:4.26, f:'£7634.10'}],
['user 4',{v:0.96, f:'£1714.00'}],
['user 5',{v:7.27, f:'£13013.40'}]


On my clientside file, I am using a bit of jquery to get that data:

1:
2:
3:
4:
5:
6:
$.ajax({
url: 'get_json.aspx',
type: 'POST',
data: { strDepartment:"Technology" },
success: function() { }
});


On the same clientside file, I have a google chart which I need to populate with the json data:

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
<script type="text/javascript">
	function drawVisualization() {
		var data = new google.visualization.DataTable();
		data.addColumn('string', 'WIP');
		data.addColumn('number', 'Percentage');
		data.addRows([
			// the returned json data needs to go here somehow
		]);
	new google.visualization.PieChart( document.getElementById('visualization')).draw(data, {width: 400, height: 240, is3D:true}); }
	google.setOnLoadCallback(drawVisualization);
</script>


How do I stick the json data into the google chart?

Any suggestions?

Thanks

Answer : json to javascript - google charts

.. forgot one slash

0 22 * * * [ $(date +\%Y\%m\%d) -le 20100724 ] && /path/to/schel.sh  >/dev/null 2>&1

Random Solutions  
 
programming4us programming4us