1
我想創建一個數據31天的圖形,然後用變焦上我希望能夠以放大的日子例如,如果7天我是要突出7天。jqPlot圖變焦31天
我的問題是我要在x軸上的標籤,在第一天,最後一個是最後一天開始,但jqPlot似乎對某些原因加入天。
例如,我的數據在下面,它開始x軸21和最後一個是26,但我希望它顯示每一天從22日至23日。 我嘗試使用最小和最大,但只有一個工作。
我也想它來顯示每一天1,2,3,4等,而不是1,5,12,19等,因爲它目前確實。
當你有時它也有3,4,4,4,5,5,5,6等我總是希望它每一天放大我也注意到了。
這裏是我當前的代碼:
$(document).ready(function(){
s1 = [["6/22/2012",425.32], ["6/23/2012",424.84], ["6/24/2012",417.23], ["6/25/2012",390],
["6/26/2012",393.69], ["6/27/2012",392.24], ["6/28/2012",369.78], ["6/29/2012",330.16], ["6/30/2012",308.57],
["7/1/2012",346.45], ["7/2/2012",371.28], ["7/3/2012",324.7], ["7/4/2012",315.07], ["7/5/2012",300.36],
["7/6/2012",315.76], ["7/7/2012",292.96], ["7/8/2012",310.02], ["7/9/2012",359.36], ["7/10/2012",372.54],
["7/11/2012",386.91], ["7/12/2012",449.15], ["7/13/2012",444.25], ["7/14/2012",463.29], ["7/15/2012",510.15],
["7/16/2012",467.86],["7/17/2012",467.86], ["7/18/2012",481.32], ["7/19/2012",537], ["7/20/2012",546.43], ["7/21/2012",567],
["7/22/2012",544.62], ["7/23/2012",573.2]];
var plot1 = $.jqplot('chart1', [s1], {
title: 'test',
series: [{
label: 'test',
renderer:$.jqplot.BarRenderer
}],
axes: {
xaxis: {
renderer:$.jqplot.DateAxisRenderer,
tickOptions:{formatString:"%#d"}
},
yaxis: {
// renderer: $.jqplot.LogAxisRenderer,
tickOptions:{
formatString:'$%.2f'
}
}
},
cursor:{
show: true,
zoom: true,
constrainZoomTo: 'x'
}
});
});
誰能幫助我?