使用 flot 的钟形曲线

bell curve using flot

我从下面 link 实现了一个钟形曲线: Create Normal Distribution (Bell Curve) chart using FLOT

如何像图像一样将线放在贝尔曲线上:

基于 comment in the question you linked, you can use markings to achieve this (see this fiddle):

相关代码:

var markings = [];
for (var i= -2; i <= 2; i+= 1) {
    markings.push({ xaxis: { from: i, to: i }, yaxis: { from: 0, to: NormalDensityZx(i,0,1) }, color: "#bb0000" });
}