How do I do have colorformat on a cell based on a range and set properties on a data cell to change font size and background color at the same time?

267 views
Skip to first unread message

Max

unread,
Sep 21, 2009, 12:58:58 PM9/21/09
to Google Visualization API
I do the following in my code

data.setProperties(i, 0, {'style': 'background-color: #EEEEEE; font-
size:20px;'});
data.setProperties(i, 1, {'style': 'background-color: #EEEEEE; font-
size:20px;'});


var table = new google.visualization.Table(document.getElementById
('tablediv'));
var formatter = new google.visualization.ColorFormat();
formatter.addRange(40,null , 'white', 'orange'); // apply color
format
formatter.format(data, 3); // Apply formatter to fourth column

table.draw(data, {allowHtml: true});

however the colorformat() overides my properties. How can I do both?

VizWiz

unread,
Sep 24, 2009, 7:23:38 AM9/24/09
to google-visua...@googlegroups.com
Hi,

Formatters work by modifying the formatted values of cells.
Setting properties of style are working in some of the charts (table, org chart).
The combination is not guaranteed to work, as they use the same mechanism.

Cheers,
VizWiz

Reply all
Reply to author
Forward
0 new messages