Problem with Special Characters

60 views
Skip to first unread message

trebew

unread,
May 24, 2012, 11:04:37 PM5/24/12
to google-visua...@googlegroups.com
Hi...

I found this nice google api just a couple of days and i'm trying to use it but it doesn't work =/

In fact I know what's going wrong. I'm brazilian and the portuguese have some special characters like á é í â ê ç and so on. When the data have one of this characters ths script just don't work, for exemple:

function drawVisualization({
  // Create and populate the data table.
  var data google.visualization.arrayToDataTable([
    ['Poduto','Desc_Produto','Descricao'],
    ['Transporte','Combustível','Gasolina Comum'],
    ['Diversão','Cinema','Severiano Ribeiro']
  ]);

  // Create and draw the visualization.
  visualization new google.visualization.Table(document.getElementById('table'));
  visualization.draw(datanull);
}

The code above don't produce any output. It's because of words 'Combustível' and 'Diversão'. Now if i change it to:

function drawVisualization({
  // Create and populate the data table.
  var data google.visualization.arrayToDataTable([
    ['Poduto','Desc_Produto','Descricao'],
    ['Transporte','Combustivel','Gasolina Comum'],
    ['Diversao','Cinema','Severiano Ribeiro']
  ]);

  // Create and draw the visualization.
  visualization new google.visualization.Table(document.getElementById('table'));
  visualization.draw(datanull);
} 

Then it works just great. But I want to use those special characters. Anyone knows how can I do this?

asgallant

unread,
May 25, 2012, 9:17:19 AM5/25/12
to google-visua...@googlegroups.com
You'll need too use the HTML encoded version of the characters, ie:

ã = ã

used like this:

['Diversão','Cinema','Severiano Ribeiro']
Reply all
Reply to author
Forward
0 new messages