我关注arrayToDataTable的谷歌图表文档,示例说明我可以使用格式化值,如下所示:
var data = google.visualization.arrayToDataTable([
['Employee Name', 'Salary'],
['Mike', {v:22500, f:'18,500'}],
...
其中f:'18,500是要显示的格式化值。我的代码看起来相同:
var data = google.visualization.arrayToDataTable([
['Category', 'Amount'],
['Food', {v:5595.819984, f:'5.595,82'}],
['Home', {v:1890.530002, f:'1.890,53'}],
['Mail', {v:8.380000, f:'8,38'}],
['Train', {v:564.899998, f:'564,90'}],
['Photo', {v:959.119995, f:'959,12'}],
['Lego', {v:428.760004, f:'428,76'}],
...
但图表甚至没有显示,崩溃。如果我取出格式化的数据,它会完美运行。我做错了什么?如何使用更好看的版本来显示图表上的值?