2012-08-14 137 views
1

我的JQPlot圖表當前正在渲染所有內容,但唯一的問題是刻度標籤正在被圖表重疊。無論如何,我可以抵消標籤,以防止這種情況發生或簡單的選項更改?我還沒有在JQPlot網站上找到任何關於此的東西,所以任何幫助,將不勝感激。以下是一些示例代碼:JQPlot Y軸標籤偏移量

var moduleTypesChart = $.jqplot("moduleTypesChart",[moduleTypesCount], { 
          title:'<h2>Module Types Distribution</h2>', 
          seriesColors:["darkred"], 
          seriesDefaults:{ 
           renderer:$.jqplot.BarRenderer, 
           rendererOptions: {fillToZero: true, varyBarColor: false} 
          }, 
          axesDefaults:{ 
           tickRenderer: $.jqplot.CanvasAxisTickRenderer, 
           tickOptions:{ 
            angle: -15, 
            textColor:'black', 
            labelPosition:'middle', 
            fontFamily:"Arial", 
            fontWeight:"bold" 
           } 
          }, 
          axes: { 
           xaxis: { 
            renderer: $.jqplot.CategoryAxisRenderer, 
            ticks: moduleTypes 
           } 
          }, 
          grid: { 
           background:'Gainsboro', 
           gridLineColor:'LightSteelBlue' 
          } 

回答

4

您可以通過修改CSS來完成此操作。

在你jqPlot目錄中有兩個文件:jquery.jqplot.cssjquery.jqplot.min.css

裏面是y軸的標籤CSS類:

.jqplot-yaxis-label { 
    margin-right: 20px; 
    font-size: 11pt; 
    position: absolute; 
} 

您可以增加右邊距,以避免與蜱重疊。

記住要確保鏈接到你的HTML文檔的頭部其中的一個文件,例如:

<link rel='stylesheet' type='text/css' href='/DHTML/jqplot/jquery.jqplot.css'>