While the new tutorials are useful in helping users prepare the data (ie, specifying the order of sort), but not exactly how to actually control the sorting behaviors of bokeh per se.
In the enclosed example:
the legends shows order of the day as humans expect
the labels are however, sorted in a different way…
It’s straight forward to sort [‘Monday’, ‘Tuesday’, … ‘Sunday’] with an external index or dictionary, but it’s not clear to me how I can tell bokeh to arrange the groups as shown in the legend. Since the legend is done correctly, how do I inform bokeh to sort the group exactly the same way?
bar_grp = Bar(df2,
label=‘Timegrp’,
values=‘Incident’,
agg=‘count’,
group=cat(columns=[‘Day’], sort=False),
title=“Car Break-in by Time Groups and Day of Week”,
As an experiment, I created a separate integer column for each day string and sorted the DF against that column, hoping that it would make it easier for bokeh to maintain the sorting order. But that didn’t work either.