0

使用stackoverflow,我正在用谷歌做我自己的图表。我读过这个: Google Chart 中的 Tooltip while populating chart using JSON and with this "instruction" I've tried to do with myself a multi line chart with custom tooltip但没有结果。

我试过类似的东西

{"cols": [{"id": "", "label": "Date", "type": "string"},
    {"id": "", "label": "price", "type": "number"},
    {"id": "", "role": "tooltip", "type": "string", "p" : { "role" : "tooltip" } } 
    {"id": "", "label": "price2", "type": "number"},
    {"id": "", "role": "tooltip", "type": "string", "p" : { "role" : "tooltip" } } 
],
"rows": [
    {"c":[{"v": "Apr 24th","f":"null"}, {"v": 56000,"f":"56000"}, {"v": "24 April, Price - 56000, Seller-abcd"}, {"v": 50000,"f":"56000"}, {"v": "24 April, Price - 56000, Seller-abcd"}]},
    {"c":[{"v": "May 3rd","f":"null"}, {"v": 68000,"f":"68000"}, {"v": "3 May, Price - 68000, Seller-abcd"}, {"v": 56000,"f":"56000"}, {"v": "24 April, Price - 56000, Seller-abcd"}]},
    {"c":[{"v": "May 13th","f":"null"}, {"v": 50400,"f":"50400"}, {"v": "23 May, Price - 50000, Seller-abcd"}, {"v": 56000,"f":"56000"}, {"v": "24 April, Price - 66000, Seller-abcd"}]}
]}

那有什么问题呢?我想指定:单行(复制上面链接的代码)这工作正常,我有我的好图表:D 任何人都可以帮助我吗?

4

1 回答 1

0

您的第一个工具提示列后缺少逗号:

"cols": [
    {"id": "", "label": "Date", "type": "string"},
    {"id": "", "label": "price", "type": "number"},
    {"id": "", "role": "tooltip", "type": "string", "p" : { "role" : "tooltip" } }, // <--- need a comma here
    {"id": "", "label": "price2", "type": "number"},
    {"id": "", "role": "tooltip", "type": "string", "p" : { "role" : "tooltip" } } 
]
于 2013-11-05T16:30:01.833 回答