2011-08-04 3 views
5

좋아, 막대 차트가 있습니다. 그리고 기본적으로 작동하지만 ... y- 축의 레이블은 다소 길며 포장하고 서로 마주 치게됩니다.jqplot에서 y 축 레이블 영역의 너비 변경

CSS를 변경해 보았지만 JS에 의해 무시되었습니다. jqplot 라이브러리를 통해 스캐닝을 시도해 어디에서 발생했는지 알 수는 있지만 잃어 버렸습니다. 아이디어가 있으십니까? 내가 설정할 수있는 옵션이 있니?

당신은 여기에서 볼 수 있습니다 여기에

enter image description here

내 HTML 파일입니다

<html> 
<head> 
<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]--> 
<script language="javascript" type="text/javascript" src="jquery.min.js"></script> 
<script language="javascript" type="text/javascript" src="jquery.jqplot.min.js"></script> 
<script language="javascript" type="text/javascript" src="jqplot.barRenderer.min.js"></script> 
<script language="javascript" type="text/javascript" src="jqplot.categoryAxisRenderer.js"></script> 
<link rel="stylesheet" type="text/css" href="jquery.jqplot.css" /> 
<script> 
    $(function() { 
     graph_me('chart1',[ 'This is a label', 'This is another label..', 'Is this too long? This looks like it might break','Im not sure, but '], [40, 20, 5, 1]); 
    }); 
    function graph_me(div_name, labels_in, values_in) { 
     var labels = labels_in.reverse(); 
     var values = values_in.reverse(); 
     $.jqplot(div_name, [values], { 
      series:[{ 
       renderer:$.jqplot.BarRenderer, 
       rendererOptions: { 
        barDirection: 'horizontal', 
        varyBarColor: true 
        } 
       } 
      ], 
      axes: { 
       yaxis: { 
        renderer: $.jqplot.CategoryAxisRenderer, 
        ticks: labels, 
        tickOptions: { 
         showGridline: false, 
         markSize: 0 
        } 
       } 
      } 
     }); 
    } 
</script> 
</head> 
<body> 
<div id="chart1" style="height:400px;width:500px; margin: 0 auto;"></div> 
</body> 
</html> 
+0

나는 SAE를 데 문제 icchanobot - 솔루션을 찾을 수 있었습니까? – davy

+0

@davy : 아래 해결 방법은 나를 위해 일했고, 나는 단지'! important' 부분이 필요하다고 생각합니다. – icchanobot

답변

7

당신은 당신의 CSS에서 이것을 시도 할 수 :

.jqplot-yaxis { 
    margin-left:-80px !important; 
    width:80px !important; 
} 
+0

안녕하세요, 고마워요, 저는 이것과 비슷한 답변을 사용하여 그것을 계산했습니다. – icchanobot