我正在使用最漂亮的 javascript 绘图插件flot
在折线图的帮助下描绘一些实时数据。
我有以下一组选项:
{
colors: ['#7999BB'],
grid: { borderWidth: 1, borderColor:"#4572A7"},
xaxis: {
axisLabel: "Time (H:M)",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 11,
axisLabelFontFamily: 'sans-serif',
axisLabelPadding: 9,
mode:"time",
tickSize: [25, "minute"],
tickLength:5,
tickFormatter: function (v, axis) {
var date = new Date(v);
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
return hours + ":" + minutes;
}
},
series: { shadowSize: 0,
lines: {
show: true,
lineWidth: 1.2,
fill: true,
fillColor: { colors: [ { opacity: 0.3 }, { opacity: 0 } ] }
}
},
yaxis: { show: true,
min:0,
}
}
一切正常。但我想突出显示图中的单点。我尝试使用
plot.highlight(seriesIndex,dataPoint);
我做了
plot.highlight(0, 99);
0 - I have just single series.
99 - I am plotting 100 points and lets say for example I want to highlight 99th point.
控制台没有错误。但它不工作?如何突出显示时间序列图中的点?
任何帮助将不胜感激。