-1

I have a JSON with this format :

[15:17:37,612] ({Rb:"0.6", I:[{id:"cost_reportings_timestamp", label:"cost_reportings_timestamp", type:"date", pattern:""}, {id:"Bureau de M. le Maire min-sum-cost_reportings_cost", label:"Bureau de M. le Maire", type:"number", pattern:""}, {id:"Salle de r\xE9union min-sum-cost_reportings_cost", label:"Salle de r\xE9union", type:"number", pattern:""}, {id:"Secr\xE9tariat / accueil min-sum-cost_reportings_cost", label:"Secr\xE9tariat / accueil", type:"number", pattern:""}], K:[{c:[{v:(new Date(1354921200000))}, {v:0}, {v:1.8221145868301392}, {v:1.0604355335235596}]}, {c:[{v:(new Date(1355007600000))}, {v:0}, {v:2.288118362426758}, {v:0}]}, {c:[{v:(new Date(1355094000000))}, {v:0.4536628723144531}, {v:2.1034255027770996}, {v:1.1031612157821655}]}, {c:[{v:(new Date(1355180400000))}, {v:0.4586494266986847}, {v:2.0204458236694336}, {v:1.9794343709945679}]}, {c:[{v:(new Date(1355266800000))}, {v:0.44572973251342773}, {v:2.406118154525757}, {v:1.0900148153305054}]}, {c:[{v:(new Date(1355353200000))}, {v:1.0 […]

I have a problem with this because I used the googlechart and my chart can't read the format of my JSON. The format of my JSON isn't good, it's like this

" new Date(2012,11,17) "  

but I need something like this

" Date(2012,11,17) "

Could you help me ?

4

1 回答 1

0

我不知道 API,但很可能您需要构建 Date 对象并将其转换为日期字符串,然后再发送 JSON 对象。

尝试类似的东西

var date1 = new Date(2012,11,17).toJSON();
...
google.visualization.Query.setResponse({...,{"v": date1}...});
于 2013-08-07T13:56:58.343 回答