alternatingRowStyle has no effect?

247 views
Skip to first unread message

NA

unread,
Jun 23, 2011, 11:39:53 AM6/23/11
to Google Visualization API
Does alternatingRowStyle do anything? I've set it to both true and
false in the snippet below, but the table looks the same.



function drawVisualization() {
// Create and populate the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Name');
data.addColumn('number', 'Height');
data.addColumn('boolean', 'Smokes');
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, 174);
data.setCell(1, 1, 523);
data.setCell(2, 1, 86);
data.setCell(0, 2, true);
data.setCell(1, 2, false);
data.setCell(2, 2, true);

// Create and draw the visualization.
visualization = new
google.visualization.Table(document.getElementById('table'));
visualization.draw(data,
{alternatingRowStyle:false,showRowNumber:true});
}

asgallant

unread,
Jun 23, 2011, 12:16:14 PM6/23/11
to google-visua...@googlegroups.com
It is doing something, but the current default is to set the "odd" rows to a background color of "#FAFAFA", which is barely distinguishable from the base "#FFFFFF".  Use the cssClassNames object to assign class names to the even and odd rows, and then style them with CSS.

NA

unread,
Jun 23, 2011, 12:41:38 PM6/23/11
to Google Visualization API
ah, ok, its very subtle. thanks
Reply all
Reply to author
Forward
0 new messages