If you are using a Dashboard, you are using ChartWrappers >;o)
Changing from one to the other is very easy:
// these two methods create the exact same line chart
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, {
height: 400,
width: 600
});
var wrapper = new google.visualization.ChartWrapper({
chartType: 'LineChart', // this string is the same as the chart type in "google.visualization.<chart type>"
containerId: 'chart_div', // pass the same id here that you would pass to document.getElementById
dataTable: data, // the DataTable/DataView to use for drawing the chart; omit this when using a Dashboard
options: {
// put the same options in here that you would when calling chart.draw
height: 400,
width: 600
},
view: {
// you can specify which rows/columns to include in the chart here, using the "rows" or "columns" properties
}
});
wrapper.draw();
Personally, I prefer ChartWrappers, as they store the chart parameters in the wrapper so you don't have to keep track of them separately. If you want to have your table display a limited set of columns, set the view.columns parameter in the table's wrapper, like this:
view: {
columns: [0, 1, 3, 6] // use columns 0, 1, 3, and 6 to draw the table