移动 dygraphs 弹出标签

Move dygraphs pop-up label

当我将鼠标悬停在我的 dygraph 图表中的一条线上的点上时,会弹出一个很好的东西并显示 X 和 Y 位置以及我的 CSV 中的哪一列由 Y 点表示。这是默认设置。

弹出文本位于我图表的左上角并与 Y 轴相交。我怎样才能把它移到右边?我不知道怎么做,因为我不知道弹出窗口叫什么。

初始化如下:

<html>
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/dygraph/2.0.0/dygraph.min.js"></script>
<link rel="stylesheet" src="//cdnjs.cloudflare.com/ajax/libs/dygraph/2.0.0/dygraph.min.css" />
</head>
<body>
<div id="graphdiv"></div>
<script type="text/javascript">
  g2 = new Dygraph(
    document.getElementById("graphdiv"),
    "file.csv", 
  );
</script>
</body>
</html>

文件如下:

Timestamp,Value
2017-01-01T00:00,12345

在你的 css

中试试这个
.dygraph-legend { 
   text-align: right; 
   background: none; 
}