我对justGage.js有点新意,我想从MySQL加载一些数据。这是我的量具代码:
var g3 = new JustGage({
id: "g3",
value: 0,
min: 0,
max: 1000,
title: "Scripts Started Today",
label: "",
levelColors: ['#1ab394'],
levelColorsGradient: false
});
... AJAX调用是这样的:
(function updateScripts() {
$.ajax({
type: "GET",
url: '@Url.Action("GetQueryResult")',
context: document.body,
data: {
querySetName: 'dashboard-script-statistics',
queryName: 'NumOfStartedScript'
},
success: function (serveData) {
serveData = JSON.parse(serveData);
if (serveData.Success) {
$("#stat-7-value").html(serveData.Result.NUM_SCRIPT_STARTED_TODAY);
g3.refresh(serveData.Result.NUM_SCRIPT_STARTED_TODAY);
} else {
$("#stat-7-value").prop(serveData.ErrorMessage);
}
},
error: function (xhr) {
$("#stat-7-value").attr('title', 'Error Status: ' + err.status);
},
complete: function () {
setTimeout(updateScripts, 2000);
}
});
})();
这是一个0而不是3.我检查了数据,没关系。但是显示的值是0。