嗨,我正在尝试将数据绑定到 kendochart,但图表上没有出现任何条形图。如果我在 Web 浏览器中获取 url,则会返回以下字符串。
[{"AreaName":"Rondebosch","NumberOfIncidents":2}, {"AreaName":"Claremont","NumberOfIncidents":2}, {"AreaName":"Athlone","NumberOfIncidents":2}]
代码如下
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"}]
});
}
});
请帮忙...