How to show long text descriptions on hover using high-level Bar chart

Hi,

I’m trying to show some long text descriptions on hover, but I can’t quite figure out how to do it. I don’t want the descriptions to show up in the x-axis ticks, because they are pretty long and they make the x-axis space out incorrectly. But I’m not sure how to reference them in the hover window if they’re not in the ‘cat’ variable. I can’t put them in as an additional column because they are text data and the high level Bar chart expects numeric columns.

descriptions=[‘long description1’, ‘long description 2’, ‘long description 3’, ‘long description 4’, ‘long description 5’]

data = {“z”: [1, 5, 12, 4, 2]}

p = Bar(data, width=500, height=500)

hover = HoverTool(

tooltips = [

(“index”, “$index”),

("(x,y)", “($x, $y)”),

(“z”, “@z”),

]

)

p.add_tools(hover)

show(p)

Is this something that should even be done using the high-level Bar chart, or am I better off downshifting into the bokeh.plotting library? Or am I a perhaps making an error on some other level?

Thanks,

John

Sorry for the double posting.

Is there some additional information I can add to express the problem more clearly?

···

On Fri, Jun 12, 2015 at 11:21 AM, John Fries [email protected] wrote:

Hi,

I’m trying to show some long text descriptions on hover, but I can’t quite figure out how to do it. I don’t want the descriptions to show up in the x-axis ticks, because they are pretty long and they make the x-axis space out incorrectly. But I’m not sure how to reference them in the hover window if they’re not in the ‘cat’ variable. I can’t put them in as an additional column because they are text data and the high level Bar chart expects numeric columns.

descriptions=[‘long description1’, ‘long description 2’, ‘long description 3’, ‘long description 4’, ‘long description 5’]

data = {“z”: [1, 5, 12, 4, 2]}

p = Bar(data, width=500, height=500)

hover = HoverTool(

tooltips = [

(“index”, “$index”),

(“(x,y)”, “($x, $y)”),

(“z”, “@z”),

]

)

p.add_tools(hover)

show(p)

Is this something that should even be done using the high-level Bar chart, or am I better off downshifting into the bokeh.plotting library? Or am I a perhaps making an error on some other level?

Thanks,

John

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/50ab2d6d-3fa8-42d7-9657-2f6764921982%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.