-1

我正在使用谷歌图表。我需要在 y 轴上的值以及气泡中的值之前添加一个“$”。

有这个设置吗?

保重,李

更新,

以下是图表使用的数据:

'Month','Semi-Detached in Toronto E04','Semi-Detached in Toronto E08','Condominium Townhouse in Toronto E04','Condominium Townhouse in Toronto E08',                ],
                ['7/2011', 4354000,15305800,6776500,495000],['8/2011', 700000,10514418,7060786,0],['9/2011', 6854800,17805400,12087300,0],['10/2011', 7287400,14248900,16206500,0],['11/2011', 2696245,9733270,12698090,0],['12/2011', 1965800,6054500,8854390,0],['1/2012', 2450968,9012200,5500100,0]             ]);

我已经尝试在值之前添加 '$' 以及之前建议的 '%24' ,但两者都会引发语法错误。如果不引发 Google Charts 错误“轴#0 的数据列不能属于字符串×”类型,则无法引用这些值。

谢谢各位的意见。我发现了一个 99.9% 相同的问题: How to set tooltips to display percents to match axis in Google Visualization Line Chart?

4

2 回答 2

1

尝试使用 %24,它是 $ 的 urlencoded 形式。

于 2013-03-26T14:07:15.340 回答
0

利用:

var formatter = new google.visualization.NumberFormat({prefix: '$'});

在此处查看示例:

https://developers.google.com/chart/interactive/docs/examples#interaction_example

更多细节在这里:

https://developers.google.com/chart/interactive/docs/reference#numberformatter

于 2014-05-06T02:51:45.203 回答