我有一個對象,我存儲數據的Javascript x被未定義對象/陣列
{"anti-social-behaviour":43,"burglary":24,"other-theft":29,"shoplifting":2,"vehicle-crime":27,"violent-crime":34,"criminal-damage-arson":17,"public-order":2,"drugs":1,"robbery":3,"other-crime":3,"bicycle-theft":1}
我想要這個數據解釋成圖表,谷歌API。使用以下
data.addRows([
['Drugs', crimes.drugs],
['bicycle-theft', crimes.bicycle-theft],
]);
crimes.drugs工作正常,但是crimes.bicycle盜竊被扔
Uncaught (in promise) ReferenceError: theft is not defined
at drawChart (crimes.js:126)
at <anonymous>
你能設置像「公共秩序」的價值觀嗎?如果是的話,這可能是圖表api將短劃線解釋爲負數的問題 –