2017-08-02 43 views
1

需要幫助爲Flot中的多個y軸設置選項。這是當前圖形:enter image description here帶有多軸和複選框的jQuery Flot

我想將這些屬性應用到Y軸:

$.plot("#placeholder", data, { 
     xaxis: { 
      tickDecimals: 0 
     }, 
     yaxis: [{ 
      position: "left", 
      min: 0, 
      tickFormatter: function (val, axis) { 
      return val + "v"; 
      }, 
     },{ 
      min: 0, 
      position: "right", 
      tickFormatter: function (val, axis) { 
      return val + "M"; 
      }, 
     }] 
}); 

但我不明白爲什麼我的代碼不能在這裏工作:Fiddle here

+0

我猜你只是複製粘貼文件的代碼,並與,我從文檔http://jsfiddle.net/ofv6fb2t/2/ – LogicBlower

+0

複製我想兩個Y軸比較你的。一個座標軸位於左側(位置:「左側」),其值爲(「483994v」「479060v」...)數據集對象:「usa」,「russia」,「uk」。右邊第二個(位置:「右邊」)數據集對象的值(「55627M」「55475M」...):「germany」。 – TanyaS

+0

然後我想你需要檢查多軸示例 http://www.flotcharts.org/flot/examples/axes-multiple/index.html – LogicBlower

回答