带有多轴和复选框的jQuery Flot

问题描述:

需要帮助为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

的选项多轴是yaxes而不是yaxis。看到这个更新fiddledocumentation

enter image description here

+0

非常感谢!) – TanyaS