Here's an exmaple that you can paste in the playground:
function drawVisualization() {
// Create and populate the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Name');
data.addColumn('number', 'Percent');
data.addRows(3);
data.setCell(0, 0, 'Tong Ning mu');
data.setCell(1, 0, 'Huang Ang fa');
data.setCell(2, 0, 'Teng nu');
data.setCell(0, 1, 34, '34%');
data.setCell(1, 1, 45, '45%');
data.setCell(2, 1, 86, '86%');
var view = new google.visualization.DataView(data);
view.setColumns([
0,1,
{type: 'number',
label: 'Calculated',
calc: function(dataTable, rowNum){
return dataTable.getValue(rowNum, 1) * 2;
}
}
]);
// Create and draw the visualization.
visualization = new
google.visualization.Table(document.getElementById('table'));
visualization.draw(view);
}
What is the best way to format the calculated column to display the
percentage signs?
Thanks
Laurent
On Jul 9, 3:24 am, ChartMan <
chart...@google.com> wrote:
> Can you please give an example of a data input and the required output.
>
> Thanks
> ChartMan
>
>
>
> On Fri, Jul 9, 2010 at 2:26 AM, laurenty <
laure...@gmail.com> wrote:
> > Is it possible to specify the pattern of a calculated column in
> > DataView without to use google.visualization.PatternFormat afterwards?
>
> > Thanks
>
> > Laurent
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Visualization API" group.
> > To post to this group, send email to
> >
google-visua...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
google-visualizati...@googlegroups.com<google-visualization-
api%2Bunsu...@googlegroups.com>
> > .