☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Hiding hex number from hover tool swatch

Community Support
tmikolajczyk
tmikolajczyk

Hi,

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
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')

show(p)

Result:
hover_hex

⌁   Link to post
p-himik
p-himik

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.

⌁   Link to post

End of archived discussion · Replies are disabled