1
我正在使用dygraph来监视CSV文件并使用动态更新功能。当我将鼠标悬停在图表上以显示图例中的曲线值时,只要图形更新就会消失,这有点烦人。Dygraph动态更新图例值消失
<html>
<head>
<script type="text/javascript" src="/static/dygraph-combined.js"></script></head>
<body>
<div id="psu"></div>
<script type="text/javascript">
g = new Dygraph(document.getElementById("psu"), "/data/psu",
{
legend: 'always',
hideOverlayOnMouseOut: false,
ylabel: 'current (A)',
height: 480,
width: 640,
sigFigs: 2,
title: 'power interface monitor',
xValueFormatter: Dygraph.dateString_,
xAxisLabelFormatter: Dygraph.dateString_,
xTicker: Dygraph.dateTicker
});
window.intervalId = setInterval(function(){g.updateOptions({ 'file': "/data/psu" }); }, 1000);
</script>
</html>
所以图是所有正确显示和数据更新,只有传说值消失后刷新图与g.updateOptions()
。我在想也许我可以在g.updateOptions()
之后重新触发某种"mouseover"
事件,所以这些值会回来,但可能会有更清晰的方式。
谢谢。