How to have each row have different target for arrow/bar formatter ?

32 views
Skip to first unread message

v-jacko

unread,
Jun 12, 2012, 12:25:49 PM6/12/12
to google-visua...@googlegroups.com
As best I can tell, if you use Arrow or BarFormatter in a table chart, each of the values in a row is compared to the same single value (default 0).
eg.
  data.addRows([
   
['Shoes', {v:12, f:'12.0%'}],
   
['Sports', {v:-7.3, f:'-7.3%'}],
   
['Toys', {v:0, f:'0%'}],
   
['Electronics', {v:-2.1, f:'-2.1%'}],
   
['Food', {v:22, f:'22.0%'}]
 
]);
All negatives will show down/red and positives up/blue

What I'd like is for each row to have its own target - possibly as a column in the row , e.g.
  data.addRows([
   
['Shoes', {v:12, f:'12.0%'}, 15],
   
['Sports', {v:-7.3, f:'-7.3%'}, -8],
   
['Toys', {v:0, f:'0%'}, 5],
   
['Electronics', {v:-2.1, f:'-2.1%'}, -3],
   
['Food', {v:22, f:'22.0%'}, 24]
 
]);

So Shoes would be down/red as it is below 15, Sports would up/blue as it is above -8, etc

Anyone know if this is feasible and if not can I suggest it would be a very useful enhancement ?

asgallant

unread,
Jun 12, 2012, 1:29:33 PM6/12/12
to google-visua...@googlegroups.com
The formatters as is will not handle this.  You can custom format your DataTable cells, however, but using the #setFormattedValue method.
Reply all
Reply to author
Forward
0 new messages