如何将json数据绑定到KendoUI图表
在KendoUI演示站点上提供的示例中,它的图表绑定到以下格式的json数据:如何将json数据绑定到KendoUI图表,json,kendo-ui,kendo-asp.net-mvc,Json,Kendo Ui,Kendo Asp.net Mvc,在KendoUI演示站点上提供的示例中,它的图表绑定到以下格式的json数据: [ { "Booked" : 0, "Date" : "/Date(1370620800000)/", "FailedAttempts" : 0, "Views" : 0 }, { "Booked" : 0, "Date" : "/Date(1370707200000)/", "FailedAttempts" : 0, "Views" : 0 }] 但是,
[ { "Booked" : 0,
"Date" : "/Date(1370620800000)/",
"FailedAttempts" : 0,
"Views" : 0
},
{ "Booked" : 0,
"Date" : "/Date(1370707200000)/",
"FailedAttempts" : 0,
"Views" : 0
}]
但是,如果服务器以这种格式返回,该怎么办:
{ "AggregateResults" : null, "Data" : [ { "Booked" : 0,
"Date" : "/Date(1370620800000)/",
"FailedAttempts" : 0,
"Views" : 0
},
{ "Booked" : 0,
"Date" : "/Date(1370707200000)/",
"FailedAttempts" : 0,
"Views" : 0
},]
}
如何将KendoUI图表设置为绑定到“数据”节点 在数据源定义中定义,定义为“数据”
$("#chart").kendoChart({
dataSource: {
transport: {
read: {
...
}
},
schema : {
data: "Data"
}
},