invalid JSON for Google Visualization API in Chrome - - but works in IE- need help!!!

48 views
Skip to first unread message

josh carrillo

unread,
Sep 21, 2016, 12:53:35 PM9/21/16
to Google Visualization API

Invalid JSON string: {"title":"Annual MI Report","legend":"bottom","hAxis":{"title":"Year","format":"#"},"vAxis":{"minValue":0,"maxValue":100,"title":"Major Incident Count"},"chartArea":{"left":100,"top":50,"width":"70%","height":"50%"},"animation":{"duration":1000}}×


I'm working on MVC5 project with the attached code

Need assistance resolving error message in Chrome, very odd this api works in IE....

 



google chart issue.zip

josh carrillo

unread,
Sep 22, 2016, 11:02:41 AM9/22/16
to Google Visualization API

For some reason I can understand - Chrome simply doesn't like the "options" string - but it works in IE

chart.draw(data, options);
this is the options data :{"title":"Annual MI Report","legend":"bottom","hAxis":{"title":"Year","format":"#"},"vAxis":{"minValue":"0","maxValue":"100","title":"Major Incident Count"},"chartArea":{"left":"100","top":"50","width":"70%","height":"50%"},"animation":{"duration":"1000"}}

this is the data :"{\"cols\":[{\"label\":\"Year\",\"type\":\"number\"},{\"label\":\"HPE\",\"type\":\"number\"},{\"label\":\"HPI\",\"type\":\"number\"},{\"label\":\"HPE/HPI\",\"type\":\"number\"}],\"rows\":[{\"c\":[{\"v\":2010},{\"v\":50},{\"v\":42},{\"v\":3}]},{\"c\":[{\"v\":2011},{\"v\":45},{\"v\":22},{\"v\":2}]},{\"c\":[{\"v\":2012},{\"v\":80},{\"v\":33},{\"v\":7}]},{\"c\":[{\"v\":2013},{\"v\":55},{\"v\":44},{\"v\":8}]},{\"c\":[{\"v\":2014},{\"v\":70},{\"v\":55},{\"v\":4}]},{\"c\":[{\"v\":2015},{\"v\":66},{\"v\":8},{\"v\":11}]},{\"c\":[{\"v\":2016},{\"v\":22},{\"v\":11},{\"v\":5}]}]}"
Reply all
Reply to author
Forward
0 new messages