Ben
unread,Aug 31, 2011, 2:43:18 PM8/31/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Visualization API
Hi,
Is there a way to use chartwrapper without declaring a datatable
object to use the formated text view?
say i want this as the data table:
var data = [['name','rate1','rate2'],
['Shoes', {v:.12, f:'12.0%'}, {v:.12, f:'12.0%'}],
['Toys', {v:0, f:'0%'},{v:.12, f:'12.0%'}],
['Electronics', {v:.21, f:'21%'},{v:.12, f:'12.0%'}],
['Food', {v:.22, f:'22%'},{v:.12, f:'12.0%'}]
];
var wrapper = new google.visualization.ChartWrapper({
chartType: 'ColumnChart',
dataTable: data,
options: {title: 'Test'},
containerId: 'visualization'
});
wrapper.draw();
This is not working working because it is throwing an error for the
{v...f} object.
As a workaround i need to create a DataTable:
var data = new google.visualization.DataTable();
data.addColumn('string', 'Month');
data.addColumn('number', 'Rate');
data.addColumn('number', 'Rat3');
data.addRows([
['Shoes', {v:.12, f:'12.0%'}, {v:.12, f:'12.0%'}],
['Toys', {v:0, f:'0%'},{v:.12, f:'12.0%'}],
['Electronics', {v:.21, f:'21%'},{v:.12, f:'12.0%'}],
['Food', {v:.22, f:'22%'},{v:.12, f:'12.0%'}]
]);
Is it possible to avoid this in the ChartWrapper class?
thanks