我使用jqPlot創建條形圖,但遇到了一些問題。jqPlot條形圖出現問題
問題1:圖上的第一個和最後一個條被切斷。只有一半是顯示
問題2:我不希望我的數據點跨越整個x軸。是否有數據跨越整個x軸?
ex:這就是現在的情況。
這是我傳遞進去
var chartData = [["19-Jan-2012",2.61],["20-Jan-2012",5.00],["21-Jan-2012",6.00]]
這是我使用jQuery的數據。
// Plot chart
function PlotChart(chartData, numberOfTicks) {
$.jqplot.config.enablePlugins = true;
var plot2 = $.jqplot('chart1', [chartData], {
title: 'Mouse Cursor Tracking',
seriesDefaults:{
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barPadding: 1,
barMargin: 15,
barDirection: 'vertical',
barWidth: 50
},
pointLabels: { show: true }
},
axes: {
xaxis: {
pad: 0, // a factor multiplied by the data range on the axis to give the
numberTicks: numberOfTicks,
renderer: $.jqplot.DateAxisRenderer, // renderer to use to draw the axis,
tickOptions: {
formatString: '%b %#d' // format string to use with the axis tick formatter
}
},
yaxis: {
tickOptions: {
formatString: '$%.2f'
}
}
},
highlighter: {
sizeAdjust: 7.5
},
cursor: {
show: true
}
});
}
更改x軸墊,改變或不硬派蜱的數量。 – PriorityMark 2012-01-30 04:01:20
我試着換墊,但它什麼也沒做。蜱的數量被設置爲要顯示的項目的數量...我會嘗試增加 – chobo 2012-01-30 04:47:07
增加項目的數量沒有影響 – chobo 2012-01-30 16:54:34