Hiding hex number from hover tool swatch


Is there a way to hide the hex number from hover? In the documentation there is an info that it is possible ('The available options are: hex (to display the color as a hex value), and swatch to also display a small color swatch.), but I can’t get it. Anyone could help?

A reproducible example:

from bokeh.io import push_notebook, show, output_notebook

source = ColumnDataSource(data=dict(
    x=[1, 2, 3, 4, 5],
    y=[2, 5, 8, 2, 7],
    color=['#83c065', '#27883e', '#1f9ca7', '#0ea2e9', '#01e3ed']

p = figure(plot_width=400, plot_height=400, tooltips=[("fill color", "$color[swatch]:color")],
           title="Mouse over the dots")

p.circle('x', 'y', size=20, source=source, color='color')



There’s no easy way to do that right now. If you need that functionality, please feel free to open a feature request (of course, check first if there’s one already).

The hex parameter is there to tell the tooltip to convert the color value, whatever it is, to the hex format. I agree, quite counter-intuitive.

1 Like

Thanks for the reply. Yes, sure, I’ll post a feature request for that!