2013-01-16 56 views
2

我正在使用jqplot,並且在X軸上的間距有問題。jqplot x軸間距

這是我的代碼:

$(document).ready(function(){ 

var plot3 = $.jqplot('CogsLineGraph', [[1,2,3,4,5,6], [2,3,4,5,6,7], [3,4,5,6,7,8]], 
{ 
    title:'Cogs (Last 6 Months)', 
    seriesDefaults: 
    { 
     rendererOptions: {smooth: true} 
    }, 
    series:[ 
     { 
      lineWidth:1, 
      markerOptions: { size:7, style:'dimaond' } 
     }, 
     { 
      lineWidth:1, 
      markerOptions: { size: 7, style:"dimaond" } 
     }, 
     { 
      lineWidth:1, 
      markerOptions: { size:7, style:"filledSquare" } 
     } 
     ] 
    } 
); 
}); 

這裏是在網頁上顯示的圖形的圖像:

enter image description here

在X軸,值是:

0,0.5,1,1.5,2,2.5等

請問我可否提供som È幫助修改我的代碼,使得是在X軸上的值如下:

0,1,2,3等

回答

2

嘗試此,

axes: { 
xaxis: { 

    ticks: ['1','2','3','4','5','6']; 
     } 
}