2013-06-26 33 views
1

所以我有一個包含一些樣本數據的圖形(這是不實際的數據,因爲那將填補比這個頁!)JQplot間的間距?

x  y 
3  foo;a 
4  foo;b 
5  bar;a 
6  bar;b 

enter image description here

現在

當我將數據分組到系列,讓更多的圖形感這樣

x1  x2  y 
    3  0  foo;a 
    4  0  foo;b 
    0  5  bar;a 
    0  6  bar;b 

enter image description here

正如你可以看到,無論出於何種原因,杆之間都有間距。總的趨勢是一樣的,但是有間距。我怎樣才能刪除間距?

這裏是我的陰謀代碼

title: some title, 
    seriesDefaults: { 
     renderer: $.jqplot.BarRenderer, 
     shadow: false,   
     rendererOptions: { 
      fillToZero: true, 
      highlightColors: "#000000", 
      shadowOffset: 0, 
      shadowDepth: 0, 
      barPadding: 0 
     }, 
     pointLabels: { 
      show: false 
     } 
    }, 
    grid: { 
     shadow: false 
    }, 
    highlighter: { 
     showMarker: false, 
     tooltipAxes: 'xy', 
     showTooltip: true, 
     show: true 
    }, 
    axes: { 
     xaxis: { 
      renderer: $.jqplot.CategoryAxisRenderer, 
      ticks: tick[i], 
      tickOptions: { 
       angle: -90, 
       fontSize: '0pt', 
       showMark: false, 
       showGridline: true 
      } 
     }, 
     yaxis: { 
      label: "Norm", 
      tickInterval: 1 
     } 
    } 
}); 

回答

2

根據jQplot documentation約barRenderer一個框架,我認爲你可以使用barPaddingbarMargin選項來指定您所需的空間值(0像素?)

編輯:barMargin似乎是你需要的,因爲它允許你指定組之間的像素數在相鄰軸的值。 (而barPadding允許您在相同軸值上指定相鄰小節點之間的像素數量)。

+0

系列默認值,渲染器選項我barMargin爲0,沒有工作。我將它設置爲-20,似乎工作,但不是真的 – user2414932