Hi,
Disclaimer: I am not a programmer, although I have done a very small
amount of amateur coding. I am trying to make a nice scatter plot for
my master's thesis that will display a ton of points in different
colors and different sizes. The google charts tool seems perfect for
this, although I have had a few problems getting it to work. My
dataset is simply too large to use a GET request as the URL will
inevitably be above 2k characters; I have not been able to figure out
how to do a POST request, although that may be for another time. I
tried using the Chart Wizard to automatically write the HTML that
would get me my scatter chart, but when I open the file containing the
text (below) the 'points' in the scatter chart aren't rendered. The
axes and everything else are, but not the points. The code below comes
straight from the Chart Wizard's default settings. I tried using it in
the Visualization playground and opening it in Firefox, with the same
result for both. Any help would be appreciated. Thanks so much.
Kind regards,
Tom
<html>
<head>
<title> Example Chart </title>
<script language="javascript" src="
http://www.google.com/jsapi"></
script>
</head>
<body>
<div id="chart"></div>
<script type="text/javascript">
var queryString = '';
var dataUrl = '';
function onLoadCallback() {
if (dataUrl.length > 0) {
var query = new google.visualization.Query(dataUrl);
query.setQuery(queryString);
query.send(handleQueryResponse);
} else {
var dataTable = new google.visualization.DataTable();
draw(dataTable);
}
}
function draw(dataTable) {
var vis = new
google.visualization.ImageChart(document.getElementById('chart'));
var options = {
chxl: '',
chxp: '',
chxr: '',
chxs: '',
chxtc: '',
chxt: 'x,y',
chs: '300x150',
cht: 's',
chco: 'FF9900',
chd: 't:12,87,75,41,23,96,68,71,34,9|
98,60,27,34,56,79,58,74,18,76|84,23,69,81,47,94,60,93,64,54',
chdl: ''
};
vis.draw(dataTable, options);
}
function handleQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' +
response.getDetailedMessage());
return;
}
draw(response.getDataTable());
}
google.load("visualization", "1", {packages:["imagechart"]});
google.setOnLoadCallback(onLoadCallback);
</script>
</body>
</html>