2013-05-28 52 views
1

我創建了一個帶有圖庫的折線圖。但它不起作用: - x軸步驟不顯示文本。 - y軸步驟顯示不正確的mersuare。 這裏我的代碼:Graphael折線圖顯示軸步驟不正確

var paper = Raphael("chartNode","100%","100%"); 
     xAxis = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; 
     yData = [1,2,3,4,5,6,7,8,9,10,11,12]; 
     options = { 
      symbol: "circle", 
      nostroke: false, 
      smooth: false, 
      shade: true, 
      colors: ["#ffcc00","#ff0000"], 
      axis: "0 0 1 1", 
      axisxstep: xAxis.length - 1, 
      axisystep: 10 
     }; 


     var lines = paper.linechart(70,60,850,350,[0,1,2,3,4,5,6,7,8,9,10,11],yData,options); 

     lines.hoverColumn(function() { 
      this.tags = paper.set(); 
      for (var i = 0, ii = this.y.length; i < ii; i++) { 
       tagDegree = i * 90 + 45; 
       var nTag = paper.popup(this.x, this.y[i], ": " 
         + this.values[i], 'right', 5); 
       this.tags.push(nTag.insertBefore(this).attr([ { 
        fill : "#8F6F4F" 
       }, { 
        fill : "#ffffff" 
       } ])); 

      } 
     }, function() { 
      this.tags && this.tags.remove(); 
     }); 

     //set text for x axis 
     $.each(lines.axis[0].text.items, function(index, label) { 
      this.attr("text", xAxis[index]); 
     }); 

     lines.symbols.attr({ 
      r:5 
     }); 

而結果:Result

請!幫我。

回答

1

工作正常。我認爲與您的jquery ui lib的錯誤。 請嘗試重新下載最新的:http://jqueryui.com/download/

+0

是的。這是我的問題原因。謝謝 –