Hi,
Sorry for the delay, it's getting hard to keep up with the mailing list volume. To be honest, I would suggest using the bokeh.plotting API instead. There are various ways to do something like the code below, but one minimal way adapted from your code is this:
import numpy as np
import pandas as pd
from bokeh.io import show, output_file
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.palettes import Category10
from bokeh.plotting import figure
# read in some stock data from the Yahoo Finance API
df = pd.DataFrame(np.random.randn(10, 5), columns=['a', 'b', 'c', 'd', 'e'])
source = ColumnDataSource.from_df(df)
p = figure(plot_width=800)
for y, c in zip(['b', 'c', 'd', 'e'], Category10[10]):
p.line('a', y, color=c, legend=y, source=source)
p.add_tools(HoverTool(tooltips = [
("columan_name", "@{column_name}"),
("x-value", "$x"),
("y-value", "$y"),
]))
output_file("timeseries.html")
show(p)
Thanks,
Bryan
···
On May 9, 2017, at 11:05, [email protected] wrote:
Thank you Bryan,
Here's a simple sample code with same problem:
import pandas as pd
from bokeh.charts import TimeSeries, show, output_file
from bokeh.layouts import column
from bokeh.models import HoverTool
import pandas as pd
# read in some stock data from the Yahoo Finance API
data = pd.DataFrame(np.random.randn(10, 5), columns=['a', 'b', 'c', 'd', 'e'])
p = figure(plot_height=600, plot_width=800)
p = TimeSeries(data,
x='a', y=[ 'b', 'c', 'd', 'e'],
title="Timeseries", ylabel='y', legend=True, tools = 'hover')
hover = p.select(dict(type=HoverTool))
hover.tooltips = [
("columan_name", "@{column_name}"),
("x-value", "$x"),
("y-value", "$y"),
]
output_file("timeseries.html")
show(column(p))
On Tuesday, May 9, 2017 at 11:41:16 AM UTC-4, Bryan Van de ven wrote:
Hi,
Please provide example code that demonstrates the problem, that can be tested/examined.
Thanks,
Bryan
> On May 9, 2017, at 10:35, ghr...@gmail.com wrote:
>
> Can a user use the title (header) of a pandas column data set to label a plot name via hover tool? Also, is it possible to pass on a legend to the hover tool (I have a plot with multiple lines).
>
> I see a discussion about this topic at link below but using "@{columan name}" doesn't seem to work.
> Hovertool does not handle spaces or parentheses in column names · Issue #4796 · bokeh/bokeh · GitHub
>
> --
> You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/264843ae-49b8-460d-8603-ff1e30046ad9%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/61dd36dd-c343-48b7-9bd2-4c94e865be9a%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.