famargar
famargar

Reputation: 3448

Disable scientific notation in hover tool Bokeh

It seems like there are plenty of answers on how to disable the scientific notation in Bokeh on numbers displayed on x and y axis. But how about disabling it for the hover tool?

Upvotes: 5

Views: 2343

Answers (2)

Aqua_George
Aqua_George

Reputation: 434

Suppress the scientific notation by making the hover tool read the particular variable as a number with predetermined decimal digits by adding {1,11...} next to the variable name.

In this case it is 2 digits for volume:

hover.tooltips = [("Date", "@Date"),  ("Volume", "@volume{1,11}")]

Upvotes: 0

famargar
famargar

Reputation: 3448

Found it, at least for my particular case it was sufficient to force the hover tool to read it as an integer:

hover.tooltips = [("Date", "@Date"),  ("Volume", "@z{int}")]

Upvotes: 8

Related Questions