Hi everybody,
Is it possible to load spreadsheet data into:
var options = {
width: 400, height: 120,
redFrom: (sheet1, cell A1, redTo: sheet1, cell A2,
yellowFrom:sheet1, cell A3, yellowTo: sheet1, cell A4,
greenFrom:sheet1, cell A5, greenTo:sheet1, cell A6,
minorTicks: 5
The gauges will need to show the percentage of a 100% target, but need to
be able to decide at what percentage the color will change. I do not want
to hardcode this.
I was thinking somehting like this, but I have no idea how to populate the
var options:
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["gauge"]});
google.setOnLoadCallback(drawGID);
function drawGID() {
var queryString = encodeURIComponent('SELECT E, F LIMIT 4'); \\this is to
load name and percentage
var query = new google.visualization.Query(
'MY SPREADSHEET HERE' + queryString);
query.send(handleQueryResponse);
}
function handleQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' +
response.getDetailedMessage());
return;
}
var data = response.getDataTable();
var options = {
width: 400, height: 120,
redFrom: 90, redTo: 100,
yellowFrom:75, yellowTo: 90,
minorTicks: 5
};
var chart = new
google.visualization.Gauge(document.getElementById('chart_div'));
chart.draw(data, options);
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.