Reputation: 163
Hey stackoverflow community, I'm trying to render a Column Chart using google.visualizations.ChartWrapper but I am unable to get the following javascript code to work:
google.load('visualization', '1', {packages: ['corechart','controls']});
google.setOnLoadCallback(drawDashboard);
function drawDashboard() {
var data = google.visualization.DataTable();
data.addColumn('string', 'Element');
data.addColumn('number', 'FillRate');
data.addRows([['Tank11Chocolate', 100.0],['Tank20Gold', 50.0]]);
var chart = new google.visualization.ChartWrapper({'chartType': 'ColumnChart','containerId': 'colChart','dataTable': data});
chart.draw();
}
Could someone with perhaps more knowledge of Google Visualizations or javascript help me out please?
Upvotes: 0
Views: 78
Reputation: 163
Apparently it's possible to stare at code for hours and still not realize that I forgot to write new when I created my DataTable object. Problem solved!
Upvotes: 1