2013-10-02 4 views
1

나는이 질문이 종류의jqPlot에서 y 축 선을 제거하는 방법은 무엇입니까?

jqPlot Styling - How to remove Y axis line?

에 중복 알고하지만 그 질문은 확인 대답을하지 않았기 때문에 (하나의 나를 위해 작동하지 않았다 게시), 그래서 여기-물어 다시.

막대 차트 예제의 jqPlot 웹 페이지에서 복사 한 간단한 예가 $ .jqplot.CategoryAxisRenderer (내 x 축과 같이 축 선을 숨길 수 있음)로 변경하지 않고 y 축 선을 제거하려고합니다. .

http://jsfiddle.net/marsant/HndmB/3/

코드 :

$(document).ready(function(){ 
    var s1 = [200, 600, 700, 1000, 600]; 
    // Can specify a custom tick Array. 
    // Ticks should match up one for each y value (category) in the series. 
    var ticks = ['May', 'June', 'July', 'August', 'September']; 

    var plot1 = $.jqplot('chart1', [s1], { 
     // The "seriesDefaults" option is an options object that will 
     // be applied to all series in the chart. 
     seriesDefaults:{ 
      renderer:$.jqplot.BarRenderer, 
      rendererOptions: { barWidth: 20 }, 
      color:'blue', 
      shadow: false, 
     }, 
     grid: { 
      drawBorder: false, 
      shadow: false, 
     }, 
     axes: { 
      // Use a category axis on the x axis and use our custom ticks. 
      xaxis: { 
       renderer: $.jqplot.CategoryAxisRenderer, 
       ticks: ticks, 
       tickOptions: { showGridline: false, showMark: false }, 
       showTickMarks: false, 
      }, 
      // Pad the y axis just a little so bars can get close to, but 
      // not touch, the grid boundaries. 1.2 is the default padding. 
      yaxis: { 
       pad: 1.05, 
       tickOptions: { formatString: '$%d', showMark: false }, 
       showTickMarks: false, 
      } 
     } 
    }); 
}); 

갱신 :

이 코드 예제 나

yaxis: { 
    renderer: $.jqplot.LinearAxisRenderer, 
    rendererOptions: { drawBaseline: false, }, 
    ... ... 
} 

답변

5

당신은 그리드 옵션 다음에 시도 할 수과 축 전에 일 옵션 t o 삽입 :

axesDefaults: { 
    rendererOptions: { 
     drawBaseline: false 
    } 
}, 

희망이 있습니다.

+0

예, 감사했습니다. – marsant

+0

예 ... 완벽하게 작동했습니다. 감사합니다. –

관련 문제