If by "switch axes" you mean choose which columns of data to use for each
chart, then yes, you can do that, but not in the Query. Use DataViews to
select columns from the DataTable:
// create a DataView based on the DataTable "data"
var view = new google.visualization.DataView(data);
// tell the view to use columns 3, 4, and 8 from data
view.setColumns([3, 4, 8]);
Then when you draw the chart, use view instead of data:
var chart = new
google.visualization.LineChart(document.querySelector('#myChartDiv'));
chart.draw(view, {/* options */});
If you are using ChartWrapper objects, you can specify the view as a part
of the object instead of creating discrete DataViews:
var chart = new google.visualization.ChartWrapper({
chartType: 'LineChart',
containerId: 'myChartDiv',
dataTable: data,
options: {/* options */},
view: {
// use columns 7, 0, 2, and 5 for this chart
columns: [7, 0, 2, 5]
}
});
On Thursday, April 17, 2014 5:13:04 AM UTC-4, Németh Attila wrote:
>
> Hi,
> I use Google Spreadsheet as data source in my visualisation reports. The
> riport contains 40+ charts so it would be necessary to limit and optimize
> Querys. I use some charts which use the same data with different axis. Now
> use two different Querys to create these charts.
> It is possibe to swich axis in google.visualization.Query() object? It
> would dramatically decrease number of Querys.
>
> Thanks.
>
--
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.