【问题标题】:non-english chars in google charts label?谷歌图表标签中的非英语字符?
【发布时间】:2009-08-04 14:25:33
【问题描述】:

非英文字符在谷歌图表labels/legends 中是否有效?

这行得通,传说显示得很好:

var chart_url = 'http://chart.apis.google.com/chart?' + 'cht=bvs' + ...some other stuff... + '&chdl=Lowest price|Average price';

这不起作用,图例根本不显示:

var chart_url = 'http://chart.apis.google.com/chart?' + 'cht=bvs' + ...some other stuff... + '&chdl=L' + unescape("%E4") + 'gsta pris|Genomsnittligt pris';

有什么想法吗?提前致谢!

/托比

-----------编辑-----------

这些都不起作用:

'&chdl=Lägsta pris|Genomsnittligt pris'

'&chdl=L& auml;gsta pris|Genomsnittligt pris'(& 后面没有空格)

'&chdl=L%E4gsta pris|Genomsnittligt pris'

%E4 == ä urlencoded。

【问题讨论】:

    标签: charts label non-english


    【解决方案1】:

    我的猜测是大多数字母都可以,但你必须做相当于对它们进行 urlencoding (see urlencode())。

    【讨论】:

    • 谢谢...但是...由于 %E4 是 urlencoded,我认为 '&chdl=L' + unescape("%E4") + 'gsta pris' 可以解决问题吗?
    • 因为您是通过 URL 发送的,所以 Google 希望对它进行 urlencoded。您是否尝试过仅发送 URL 编码值?
    【解决方案2】:

    遇到了同样的问题,结果发现谷歌图表想要以 UTF-8 进行 urlencoded 的文本(当然......)

    所以“Lägsta pris”应该是 == L%C3%A4gsta+pris

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-18
      相关资源
      最近更新 更多