我对这个问题感到疯狂,在我的浏览器和我的计算机上我可以看到图表及其列,但是在IIS上发布后,数据就在那里,但是,空图表!,这不是一个复杂的事情,但我想知道为什么会发生这种情况,我发送数据作为JSON,我也检查过我的所有javascript文件是否已经在IIS中复制,一切正常,这是我的控制器:
List<FaultStatErrorIdViewModel> erro_id = new List<FaultStatErrorIdViewModel>();
foreach (DataRow dr in dt_error.Rows)
{
FaultStatErrorIdViewModel _error = new FaultStatErrorIdViewModel();
_error.cur_year = dr["cur_year"].ToString();
_error.error_dur = dr["error_duration_this_year"].ToString();
_error.m_error_id = dr["m_error_id"].ToString();
erro_id.Add(_error);
}
return Json(erro_id, JsonRequestBehavior.AllowGet);
这是我的图表:
$.ajax({
dataType: "json",
type: "POST",
url: "@Url.Action("faultStatErrorId","Ranking")",
contentType: "application/json; charset=utf-8",
data: JSON.stringify({ "regionalManager": tmpString,"error_name":itemname, "dtFrom": dtFrom, "dtTo": dtTo }),
success: function (rslt) {
$("#error_id_Chart").kendoChart({
dataSource: {
data: rslt
},
title: {
text: "Main-Group:" + itemname,
position: "bottom",
},
chartArea: {
background: "#fcfcfc",
width: 700,
},
series: [{
// data: finaldata,
type: "column",
name: "DURATION",
color: "blue",
field: "error_dur",
categoryField: "m_error_id",
}],
legend: {
visible: false
},
valueAxes: {
name: "Duration",
title: { text: "Duration (Hrs)" },
majorGridLines: {
visible: false
},
line: {
visible: true
},
},
tooltip: {
visible: true,
// majorUnit:10,
template: " #= value #"
},
});
}
});