json - Kendoui databind with Jquery datasource not working -
hi i'm trying bind data kendochart, no bars appearing on chart. if url in web browser, following string returned.
[{"areaname":"rondebosch","numberofincidents":2}, {"areaname":"claremont","numberofincidents":2}, {"areaname":"athlone","numberofincidents":2}]
the code follows
var reports = {}; $.ajax({ url: "home/getincidentperarea", async: false, datatype: 'json', success: function (json) { reports = json; $("#chart").kendochart({ title: { text: "incidents per area" }, datasource: { data: reports }, series: [{ name: "incidents per area", field:"numberofincidents"}] }); } });
please help...
the datasource option spelled in camel case.
in addition, data source can request data directly:
datasource: { transport: { read: "home/getincidentperarea" } }
Comments
Post a Comment