document.write("<div id='snvizf99eb55e' style='width:398px; height:250px;'><center><p/><p/>Loading data ...</center></div>");
google.load('visualization', '1', {'packages':['scatterchart']});
google.setOnLoadCallback(drawChartf99eb55e);

function drawChartf99eb55e() {
	var url = 'http://sensor.network.com/rest/resources/../sqldatasource?datastreamId=4121';
	var query = new google.visualization.Query(url);
	query.setQuery('select sampleTime, `pressure`, `temperature`where (sampleTime >= 0) order by sampleTime');
	query.send(handleQueryResponsef99eb55e);
}

function handleQueryResponsef99eb55e(response) {
	if (response.isError()) {
		alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
		return;
	}
	var data = response.getDataTable();
	var chart = new google.visualization.ScatterChart(document.getElementById('snvizf99eb55e'));
	chart.draw(data, {width: 398, height: 250, titleX: 'pressure (mm)', titleY: 'temperature (centigrade)', legend: 'none'});
}
