简体   繁体   English

使用Dygraphs显示每个系列的图例

[英]Display legend for every series with Dygraphs

I am rendering multiple independent time series with Dygraphs as described here: 我正在使用Dygraphs渲染多个独立的时间序列,如下所示:

http://dygraphs.com/tests/independent-series.html http://dygraphs.com/tests/independent-series.html

The graph is rendered correctly: 图形正确呈现:

图形

However I want the legend to display the value for each and every series. 但是我希望图例显示每个系列的值。 For now only the value of the point closest to the cursor is displayed. 现在,仅显示最接近光标的点的值。

How can I fix this? 我怎样才能解决这个问题?

There's no built-in support for this. 对此没有内置支持。

To dygraphs, a selection always has a specific x-value. 对于图表,选择始终具有特定的x值。 There's no notion of a set of points with different x-values that are all selected. 没有选择全部具有不同x值的点集的概念。 That being said, you could roll your own legend behavior using highlightCallback and unhighlightCallback. 话虽如此,您可以使用HighlightCallback和unhighlightCallback来滚动自己的图例行为。 See this question/answer for an example of someone who did that. 有关此操作的示例,请参见此问题/答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM