Changing font-family

48 views
Skip to first unread message

Kushan

unread,
Jun 5, 2012, 6:16:54 PM6/5/12
to Google Visualization API
I want to change the font-family of the table. I am updating
stylesheet using the id of the div tag containing the table:

#chart_div {
font:family: "Lucida Console Unicode", "Lucida Grande", sans-serif;
}

However, it doesn't seem to be working.

If I add any other attributes, such as color:red, they however do
work.

What am I doing wrong?

I am using the following code to display a table:


<script type="text/javascript">
google.load('visualization', '1.0', {'packages':
['corechart','table']});
google.setOnLoadCallback(initialize);

function initialize() {
var query = new google.visualization.Query('https://docs.google.com/
spreadsheet/pub?key=123');
query.send(handleQueryResponse);
}

function handleQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' +
response.getDetailedMessage());
return;
}

var data = response.getDataTable();
var table = new
google.visualization.Table(document.getElementById('chart_div'));
table.draw(data,{allowHtml:true});
}

</script>

<div id="chart_div"></div>

asgallant

unread,
Jun 6, 2012, 9:35:12 AM6/6/12
to google-visua...@googlegroups.com
You need to tweak the selector a bit and change "font:family" to "font-family":

#chart_div table { 
font-family: "Lucida Console Unicode", "Lucida Grande", sans-serif; 
Reply all
Reply to author
Forward
0 new messages