On Nov 25, 2014, at 9:32 AM, [email protected] wrote:
I am trying to get the hover tool to work for the bokeh.plotting.rect plot, running on the bokeh server. Here is a snippet of the latest version of the code which generates the plot:
def bar_plot(self, df, column):
grain = self.date_grain
title = "Volume for " + self.instrument
max_value = df[column].max() * 1.1
if grain == 'day':
width = 2
color = 'green'
elif grain == 'week':
width = 10
color = 'orange'
elif grain == 'month':
width = 45
color = 'blue'
source = ColumnDataSource(
y=df[column] / 2,
plot = rect(
width=width, # This is some bug; rect() requires the width param
line_width=width, # but uses line_width
xax, yax = bplt.axis()
xax.axis_label = 'Date'
yax.axis_label = 'Volume (in shares)'
# TODO: not working. seems to need the source parameter
# specified in plot. Then x, y, height, width, etc
# are the names of columns in that frame.
tips = OrderedDict([
("(x,y)", "($x, $y)"),
hover = [t for t in plot.tools if isinstance(t, HoverTool)]
hover.tooltips = tips
Everything works, except for the hover which seems to produce no effect. Any help would be greatly appreciated.
On Tuesday, April 15, 2014 6:50:18 AM UTC-4, Thomas Rusche wrote:
is it possible to apply a hover tool for a line-plot? What I find very strange: My plot is working and being shown, but as soon as I put "hover" in my tools, it is not shown and i see a white page that only says "Plots". No difference if output_notebook or output_file is set. I am using Google Chrome.
What is the input for the hover dict? Does it have to have as many entries as my x-range is long?
I want my hover tool to show the values of other, not-plotted columns that give additional information to the plot.
And for the hover dictionary, I've both seen $ and @ in use, does it make a difference?
for plot in plots:
source = ColumnDataSource(
test = plot
y = plot
l = line(x,y,
source = source,
tools = "pan, hover,box_zoom, wheel_zoom")
ylabel = "["+getUnitByCol(getColum(Was[laufendeNummer]))+"]"
# We want to add some fields for the hover tool to interrogate, but first we
# have to get ahold of the tool. This will be made easier in future releases.
hover = [t for t in curplot().tools if isinstance(t, HoverTool)]
hover.tooltips = OrderedDict([
laufendeNummer = laufendeNummer + 1
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/0eb342bc-8b40-46ba-a478-0023d3b95e11%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.