저는 jqplot을 처음 사용했지만 매우 중요한 프로젝트에서 사용하고 있습니다. 나는 x 축에 매일 하나의 '진드기'를 갖기 위해 노력하고있다. 지금은 여러 개의 것이있다.jqPlot의 tickInterval 관련 문제
$(document).ready(function(){
var ajaxDataRenderer = function(url, plot, options) {
var ret = null;
$.ajax({
async: false,
url: url,
type: "GET",
dataType:"json",
data: {metricName: ""},
success: function(data) {
ret = data;
},
error:function (xhr, ajaxOptions, thrownError){
alert(xhr.responseText);
}
});
return ret;
};
//var jsonurl = "reports/reportData.json";
var jsonurl = "tenant/metrics/get.json";
var today = new Date();
var plot2 = $.jqplot('chart2', jsonurl,{
title: "",
dataRenderer: ajaxDataRenderer,
dataRendererOptions: {unusedOptionalUrl: jsonurl},
axes: {
xaxis: {
'numberTicks' : 7,
min: '2012-10-05',
max: today,
renderer:$.jqplot.DateAxisRenderer,
rendererOptions:{tickRenderer:$.jqplot.CanvasAxisTickRenderer},
tickInterval: '1 day',
tickOptions:{formatString:'%Y-%#m-%#d'
}
//rendererOptions: {sdaTickInterval: [1, 'month']}
},
yaxis: {
label: "MB",
tickOptions:{formatString:'%d '},
// Comment the next line out to allow negative values (and therefore rounded ones)
min: 0
}
}
});
});
I 수동 이런 클릭 수를 설정하더라도 :
여기
는 (여기서 I는 this post referred 같은 최소 및 최대를 첨가) 코드이다 : 여기서 스크린 샷이다
$(document).ready(function(){
var ajaxDataRenderer = function(url, plot, options) {
var ret = null;
$.ajax({
async: false,
url: url,
type: "GET",
dataType:"json",
data: {metricName: ""},
success: function(data) {
ret = data;
},
error:function (xhr, ajaxOptions, thrownError){
alert(xhr.responseText);
}
});
return ret;
};
//var jsonurl = "reports/reportData.json";
var jsonurl = "tenant/metrics/get.json";
var today = new Date();
var plot2 = $.jqplot('chart2', jsonurl,{
title: "",
dataRenderer: ajaxDataRenderer,
dataRendererOptions: {unusedOptionalUrl: jsonurl},
axes: {
xaxis: {
'numberTicks' : 7,
min: '2012-10-05',
max: today,
renderer:$.jqplot.DateAxisRenderer,
rendererOptions:{tickRenderer:$.jqplot.CanvasAxisTickRenderer},
ticks: ['2012-10-05','2012-10-06','2012-10-07','2012-10-08', today],
tickOptions:{formatString:'%Y-%#m-%#d'
}
//rendererOptions: {sdaTickInterval: [1, 'month']}
},
yaxis: {
label: "MB",
tickOptions:{formatString:'%d '},
// Comment the next line out to allow negative values (and therefore rounded ones)
min: 0
}
}
});
});
마크가 올바른 날짜와 일치하지 않습니다. 스크린 샷은 다음과 같습니다.
이렇게하려면 정상적인 방법이 있습니까? 나는 각 x 축 틱이 단지 하나의 날짜가되고 데이터 입력 마크가 틱의 축에 있도록하고 싶다.
이것은 나를 미치게합니다! 도와주세요! 또한
, 여기가 타임 스탬프를 포함하지 않는[[["2012-10-05 10:57:16AM", 0],["2012-10-05 11:02:14AM", 2449],["2012-10-08 08:17:47AM", 9639],["2012-10-08 08:17:53AM", 224768],["2012-10-09 07:43:19AM", 9640],["2012-10-09 07:44:01AM", 224769]]]
JSON을 게시 할 수 있습니까? 나는 당신의 문제가 거기 누워 있을지도 모른다고 내기를했습니다. – dSquared
예! 지금 당장 할거야. – streetlight
방금 게시했습니다. 그것은 전혀 도움이됩니까? 어쩌면 타임 스탬프가 그걸 버리고있을거야? – streetlight