Open neighthan opened 5 years ago
One solution
import hvplot.pandas
import pandas as pd
import numpy as np
x = np.linspace(-5, 5, 101)
df = pd.DataFrame({'sin': np.sin(x), 'cos': np.cos(x), 'x': x}).melt(
id_vars='x', value_name='y', var_name='label')
df.hvplot('x', 'y', groupby='label').overlay('label')
ahuang11's solution is not good for me since I would need to create a column containing the line series name.
My preference: Since there is already an existing label=
parameter that you can pass into a hvplot call and is being used by the legend, similarly the tooltip, should just grab that to be default "label" as well.
If present, I think including the label and group should be the default behavior for the hover tooltips.
It would be nice to be able to easily include the label for a given, e.g.,
Curve
in the hovertool. I tried doing so like thisbut my hovertool looks like:
It does seem like there is a
name
attribute, because if I doinstead, the hovertool doesn't work at all. Perhaps the label from the
hv.Curve
needs to be passed back to a bokeh glyph for this to work? Or is there a different way that I could reference the label in the hovertool?