jQuery flotcharts - 向 yaxis 标签添加单个值

jQuery flotcharts - add single value to yaxis label

如何给yaxis标签添加单值?就像这个 80 值:

1) 对于线使用 markings,例如将此添加到您的图表选项:

grid: {
    markings: [ { xaxis: { from: 0, to: 2000 }, yaxis: { from: 80, to: 80 }, color: "black" }, ... ]
    ...
}

根据您的需要和 min/max 值更改 fromto 值。

2) 对于轴上的值,您必须像这样手动添加它(参见 example):

var o = plot.pointOffset({ x: plot.getAxes().xaxis.min, y: 80.0});
$(plot.getPlaceholder()).append("<div style='position:absolute;right:" + (o.left - 4) + "px;top:" + o.top + "px;color:red;font-size:smaller;text-align:right'>80</div>");