Hello, I am trying to get a meter to talk to a Google Sheet. I have set up a sheet where Directors are reporting metrics and I want to display a metric's monthly progress in 4 color shades (red=bad, yellow=under goal, green=goal, blue=exceeding goal). I just start this process of learning how to use Google O Meter and I am having problems with how to get the line/arrow to represent the monthly number in the sheet (i.e. cell B4)
Ideally, the label above the arrow would represent the progress (bad, under goal, goal, exceeding goal) Here is my code.... <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(); dataTable.addRows(1); dataTable.addColumn('number'); dataTable.setValue(0, 0, 70); draw(dataTable); } } function draw(dataTable) { var vis = new google.visualization.ImageChart(document.getElementById('chart')); var options = { chxl: '0:|0|40|80|120', chxp: '', chxr: '0,0,120', chxs: '', chxtc: '', chxt: 'y', chs: '340x190', cht: 'gm', chco: 'FF9900', chd: 't:70', chdl: '', chl: 'Goal' }; 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> Thanks for any help you can lend to move me along. Dave -- You received this message because you are subscribed to the Google Groups "Google Chart API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-chart-api?hl=en.
