Hi Riccardo
Thank you for your assistance, my code has now developed to the below,
although I am getting the following error("missing } after property
list (retrieve_cache?
unique_id=5f67dda29e2f553b3d92717ed7ad7cc0266aa2e4,78)") in the code
playground. Although I think my code maybe a little messy, learning
this stuff very fast.
Thanks for your time
function drawVisualization() {
// Prepare the data
var query = new google.visualization.Query(
'THIS IS MY GOOGLE SPREADSHEET URL');
query.send(handleQueryResponse);
}
function handleQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' +
response.getDetailedMessage());
return;
}
var slider = new google.visualization.ControlWrapper({
'controlType': 'NumberRangeFilter',
'containerId': 'control1',
'options': {
'filterColumnLabel': 'Rate',
'minValue': 0,
'maxValue': 60
}
});
// Define a bar chart
var barChart = new google.visualization.ChartWrapper({
'chartType': 'BarChart',
'containerId': 'chart1',
'options': {
'width': 400,
'height': 300,
'hAxis': {'minValue': 0, 'maxValue': 60},
'chartArea': {top: 0, right: 0, bottom: 0}
}
function initialize() {
var opts = {sendMethod: 'xhr'};
var dashboard = new google.visualization.Dashboard('THIS IS MY
GOOGLE SPREADSHEET URL',bind(slider,barChart),draw(data));
var ControlWrapper = new google.visualization.ControlWrapper('THIS
IS MY GOOGLE SPREADSHEET URL');
var ChartWrapper = new google.visualization.ChartWrapper('THIS IS MY
GOOGLE SPREADSHEET URL');
});
google.setOnLoadCallback(drawVisualization);
On Jun 15, 1:13 pm, Riccardo Govoni <[email protected]> wrote:
> It is certainly possible.
>
> Just replace the code that assembles the datatable locally ('prepare the
> data' section) with a google.visualization.Query directed toward the
> spreadsheet containing the data you want to visualize. You can then use the
> rest of the example you posted with the datatable returned in the query
> response.
>
> An example about issuing queries to
> spreadsheets:http://code.google.com/apis/ajax/playground/?type=visualization#data_...
> ( in your case, you'll have to plug the ControlWrapper and ChartWrapper
> creation after the 'response.getDataTable()' line)
>
> Documentation about issuing
> queries:http://code.google.com/apis/chart/interactive/docs/queries.html
>
> and instructions on how to extract the query URL from your spreadsheet
> (which you will then feed to
> google.visualization.Query):http://code.google.com/apis/chart/interactive/docs/spreadsheets.html
>
> Hope this helps,
> /R.
--
You received this message because you are subscribed to the Google Groups
"Google Visualization 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-visualization-api?hl=en.