2011-05-10 126 views
5

這裏有一個默認jqPlot軸蜱:jqPlot:隱藏座標軸?

with ticks

設置 「showTicks:假」 在x軸消除一切:

without ticks

我想顯示的號碼和隱藏蜱 - 數字和粗軸線之間的小破折號。這可能嗎?

回答

6
axesDefaults: { 
    showTickMarks:false 
} 

showTicks切換的刻度線和刻度標記,並showTickMarks只有切換的刻度線。 http://www.jqplot.com/docs/files/jqPlotOptions-txt.html

編輯:

在退房的選項我誤了在代碼片段showTicks,這是我固定的。

+0

這難道不給結果在我的第二個屏幕? – 2011-09-18 16:10:01

+0

@OllieGlass謝謝,我解決了我的問題 – reckbo 2011-10-14 20:34:43

+0

不再適用於我(版本:jquery.jqplot.1.0.8r1250.zip)。請參閱下面的答案。 – Olmstov 2018-02-23 22:25:18

0

不知道框架是否因爲這個答案而改變,但它不適用於我。

這是什麼(我離開了所有的絨毛,所以你可以看到axesDefaults居住在哪裏)。

var plot1 = $.jqplot ('chart1', [line1, badLine], { 
    title:'Data Point Highlighting', 
    axesDefaults:{ 
     tickOptions:{ 
      showMark: false 
     } 
    }, 
    axes:{ 
     xaxis:{ 
      tickInterval:1, 
      min:0.5, 
      ticks: [[0.5,""],[1,"1"],[2,"2"],[2.5,""]] 
     }, 
     yaxis:{ 
      ticks: [['25', ""], ['24', "12am"], ['22', "2am"], '20', '18', ['16',"4pm"], '14', '12', '10', '8', '6', '4', '2', '0'], 
      min:0, 
      max:24, 
     } 
    }, 
    series:[ 
     { 
      showLine: false 
     }, 
     { 
      showLine: false, 
      markerOptions: { style:"x" } 
     } 
    ], 
    highlighter:{ 
     show: true, 
     sizeAdjust: 7.5 
    }, 
    cursor:{ 
     show: false 
    } 
}); 

http://www.jqplot.com/docs/files/jqplot-core-js.html#jqPlot.axesDefaults