谷歌图表 - 导致“无法读取”错误的JSON数据文件

时间:2012-08-25 18:48:20

标签: php google-visualization json

我正在构建我的第一个Google图表(横条)。

我可以在PHP中创建以下json_encoded数组,但是我收到错误“无法读取未定义的'0'的属性。”

这是json数组。知道什么是错的/缺失的吗?感谢。

{
  "cols":[
    {"id":"","label":"Title","pattern":"","type":"string"},
    {"id":"","label":"User","pattern":"","type":"number"},
    {"id":"","label":"Avg","pattern":"","type":"number"}
],
  "rows":[
    {"title":"Contacts","user":345,"avg":440},
    {"title":"Interests","user":102,"avg":60},
    {"title":"Anniversaries","user":3,"avg":0},
    {"title":"Phone","user":68,"avg":99},
    {"title":"Email","user":3,"avg":1}
]

}

0 个答案:

没有答案