Flot.js 在实时绘图上单个点不可见

Flot.js on real-time plot single dots are not visible

这是例子。 https://www.flotcharts.org/flot/examples/realtime/index.html。 当我有空数据时:

data[280] = null;
data[281] = null;
data[282] = 45;
data[283] = 45;
data[284] = null;
data[285] = null;
data[286] = 45;
data[287] = null;
data[288] = null; 

编号为[282]和[283]的点会合并显示,编号为[286]的点不会。 因此,如果具有值的点被具有空值的点包围,则不会显示在绘图上。

问题是有没有可能显示这种单点?

flot example linked to只显示线,不显示点。你不能只用一个点画一条线,所以如果你的数据包含一个被空值包围的值,你就会看到你看到的行为。

如果你想看到每个点(不管它被什么包围),你可以在系列对象(如下)中打开points.show选项。 customize the look and feel of a draw point 也有一些可用的选项(也在下方)。

series: {
    lines: { show: true },
    points: {
        show: true
        radius: 2
        symbol: "circle" or function
    }
}