Dear Bokeh Team,
Referring to the following page from the Bokeh User Guide (Handling categorical data — Bokeh 2.4.2 Documentation), I believe that the zipped list used to create “counts” should be flattened using the following extra step (the 2nd line of code in the below snippet, which I have sandwiched in between your original Bokeh code):
counts = sum(zip(data['2015'], data['2016'], data['2017']), ()) # like an hstack
flat_list = [item for sublist in counts for item in sublist]
source = ColumnDataSource(data=dict(x=x, counts=flat_list))
Doing so will ensure that ColumnDataSource has a matching number of entries.
Please let me know i this looks correct to you, happy to be corrected if you think the original code is correct!
Kind regards,
Greg