Hello,
I'm using GViz to populate a webpage with data from a Google Spreadsheet.
The columns are different types, however. Some are currency and some are
percentages. I've tried using GViz's NumberFormat to set a '$' as a
'prefix'; I've even tried to set a 'pattern'. None of which seems to work.
Can some help me out? I've included the code below.
var data = response.getDataTable();
//console.log(data);
var formatter = new google.visualization.NumberFormat({prefix:'$', pattern:
'$###,###'});
formatter.format(data, 1); // Apply formatter to second column
$bud01.html(data.getValue(0, 0));
$bud02.html(data.getValue(1, 0));
$bud03.html(data.getValue(2, 0));
$bud04.html(data.getValue(3, 0));
$bud05.html(data.getValue(4, 0));
$bud06.html(data.getValue(5, 0));
$res01.html(data.getValue(0, 1));
$res02.html(data.getValue(1, 1));
$res03.html(data.getValue(2, 1));
$res04.html(data.getValue(3, 1));
$res05.html(data.getValue(4, 1));
$res06.html(data.getValue(5, 1));
$bp01.html(data.getValue(0, 2));
$bp02.html(data.getValue(1, 2));
$bp03.html(data.getValue(2, 2));
$bp04.html(data.getValue(3, 2));
$bp05.html(data.getValue(4, 2));
$bp06.html(data.getValue(5, 2));
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/657c6e1d-9bfe-4c85-be9a-1231030927c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.