rstudio / dygraphs

R interface to dygraphs
http://rstudio.github.io/dygraphs
Other
365 stars 194 forks source link

Add series name to hover label/legend text #267

Open vinaychuri opened 5 months ago

vinaychuri commented 5 months ago

I have a dataframe that contains rows for 'Date,Prod1,Prod2,Prod3...' and i can plot the line charts via:

df%>%
dygraph()

The plot displays lines as per the columns in dataframe and the legend displays the hover data.

But with more lines its gets confusing to understand which "Product" is being viewed as no column name/label indication exists.

Is there any way to add the column name as hover text or within the legend?

vinaychuri commented 5 months ago

Update 1: The following code allows to highlight the series via hover but still no option to know the column name that is being highlighted.

dyHighlight(#highlightCircleSize = 5, 
              highlightSeriesBackgroundAlpha = 0.2,
              hideOnMouseOut = TRUE,
              highlightSeriesOpts = list(strokeWidth = 2)
              )