Re: How do I format with ColorFormat been apply to a tableChart in a dashboard ?

112 views
Skip to first unread message

asgallant

unread,
Dec 7, 2012, 8:37:46 PM12/7/12
to google-visua...@googlegroups.com
You need to format the DataTable, not the chart.  Also, you have to format each column individually, you can't pass an array of columns to the formatter.  Use this:

var formatter = new google.visualization.ColorFormat();
formatter.addRange(-20000, 0, 'white', 'orange');
formatter.addRange(20000, null, 'red', '#33ff33');
formatter.format(data, 6);
formatter.format(data, 7);
formatter.format(data, 8);

On Friday, December 7, 2012 7:22:27 PM UTC-5, Jaycee Wilken wrote:
Is there an example of how to format cell colors; where I'm using the chartwrapper as this table is associated to control?

I'm not getting this correct.

//the table
var tableChart = new google.visualization.ChartWrapper({
'chartType': 'Table',
'containerId': 'table_div',
'allowHtml': true,
});

//binding the controls
dashboard.bind([filter,categoryPicker], [lineChart,tableChart])
//creating the formatter
var formatter = new google.visualization.ColorFormat();
formatter.addRange(-20000, 0, 'white', 'orange');
formatter.addRange(20000, null, 'red', '#33ff33');
formatter.format(tableChart, [6,7,8]);

//draw the dashboard
dashboard.draw(data)




Reply all
Reply to author
Forward
0 new messages