I am trying to create a complex histogram using Bokeh. I would like to use the hover function, displaying the corresponding data in each part of the panel, but instead of the data, Bokeh shows "???".
I got the data in an excel file called "Sample Worksheet" in a worksheet called "Sales." The sheet is as follows:
Year Category Sales 2016 A 1 2016 B 1 2016 C 1.5 2017 A 2 2017 B 3 2017 C 1 2018 A 2.5 2018 B 3 2018 C 2
I tried running the following code:
import numpy as np import scipy as sp from bokeh.charts import Bar, output_file, show from bokeh.models import HoverTool import pandas as pd x = pd.read_excel('Example worksheet.xlsx', 'Sales') bar = Bar(x, label = 'Year', values = 'Sales', agg = 'sum', stack = 'Category', tools='hover') hover = bar.select(dict(type=HoverTool)) source = x hover.tooltips = [('Category', '@Category'),('Sales', '@Sales')] output_file("Expected Sales.html") show(bar)
After starting, I get the following message in the Python console (I don't think this is related to the theme, but I do it anyway):
(process:4789): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
And then in the browser I get the following diagram:

As you can see, the data is replaced by question marks. I got this result for both FF 41.0.1 and Chromium 45.0.2454.101, running on Ubuntu 15.04 (64-bit).
I read the Bokeh tutorial http://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#hovertool , but it does not apply to histograms. I also found this on Stackoverflow: The Bokeh hover tooltip doesn't display all the data - Ipython laptop . The question may be related, but to be honest, I did not quite understand the answer.