Is there a way to use the google visualization API to display column headers in an abbreviated form in a table, but show the full labels in a pie chart using the same dataset?
Check out this snippet of JavaScript:
//create the dashboard and table chart
var dashboard = new google.visualization.Dashboard(
document.getElementById('dashboard_div'));
table = new google.visualization.ChartWrapper({
'chartType': 'Table',
'containerId': 'chart_div',
'view': {'columns': ViewColumns},
'options': {
height: 400,
},
});
dashboard.bind(table);
//bind the data to the table
baseData = new google.visualization.DataTable(response);
dashboard.draw(baseData);
//add a column chart bound to the same data
var columnChart = new google.visualization.ChartWrapper({
'chartType': 'ColumnChart',
'containerId': 'column_chart_div',
'options': {
isStacked: true,
height: 400,
width: 800,
},
});
columnChart.setDataTable(table.getDataTable());
columnChart.draw();
HTML:
<div id="dashboard_div">
<div id="column_chart_div" class="inline"> </div>
<div id="chart_div"></div>