如何在Flot中显示没有Y轴的水平网格线?

时间:2015-03-09 21:20:47

标签: javascript flot

我一直在搜索flot docs和示例,以便显示水平(y轴)网格线而不绘制垂直轴值(例如0到100),但没有任何成功。

如果没有y轴值,有没有办法做到这一点?

enter image description here

而不是这个: enter image description here

1 个答案:

答案 0 :(得分:2)

是的,使用tickFormatter

yaxis: {
  tickFormatter: function(){return ''}
}

请参阅https://github.com/flot/flot/blob/master/API.md#customizing-the-axes

Fiddle