You can use the cssClassNames<https://developers.google.com/chart/interactive/docs/gallery/table#Configuration_Options>option to assign classes to rows and cells, but that only handles things at a broad level. If you want to style specific cells, that requires formatting the data.
On Monday, July 1, 2013 3:39:51 PM UTC-4, [email protected] wrote: > > Hi, > > Apologies in advance if this is a noob question but I am learning this on > the fly! > > I have implemented a DataTableGenerator on my server and I can get a table > to display in my browser. > > e.g. > Create a data table on server, > DataTable data = new DataTable(); > > ArrayList<ColumnDescription> cd = new > ArrayList<ColumnDescription>(); > cd.add( new ColumnDescription( "Date", ValueType.TEXT, "Date" ) ); > cd.add( new ColumnDescription( "Time", ValueType.TEXT, "Time" ) ); > cd.add( new ColumnDescription( "Location", > ValueType.TEXT, > "Location" ) ); > cd.add( new ColumnDescription( "Call Type", > ValueType.TEXT, > "Call Type" ) ); > cd.add( new ColumnDescription( "Unattended Time", > ValueType.NUMBER, > "Unattended Time(Mins)" ) ); > > data.addColumns( cd ); > > // Fill the data table. > try > { > for( CallDTO call : calls ) > { > data.addRowFromValues( call.getDate(), > call.getStartTime(), > call.getLocation(), > call.getCallTypeName(), > call.getUnattendedTime() ); > } > } > catch (TypeMismatchException e) > { > System.out.println("Invalid type!"); > } > > On the client side I have something like this > > // Handle the query response. > function handleQueryResponse( response ) > { > if( response.isError() ) > { > alert( 'Error in query: ' + response.getMessage() + ' ' + > response.getDetailedMessage() ); > return; > } > > // Draw the visualization. > var data = response.getDataTable(); > > var table = new > google.visualization.Table(document.getElementById('table_div')); > table.draw(data, {width: 600, height: 150, is3D: true}); > } > > This displays a plain vanilla table. > > What I would like to do is control things like the color of the text on > each row depending on what the row contains. > > I have seen css defined in html that can do this in other posts. > > Is this something I can define on the server side, or do I need to pull > the table apart, apply the css and then put it back together again? > > Thanks. > -- 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 http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/groups/opt_out.
