Bokeh - Folded and Grouped Charts

Is it possible to create a plot in bokeh that is complex and grouped? Like http://www.highcharts.com/demo/column-stacked-and-grouped/ .

A dataset is something like this

   count     date  class    user
    39  2016/12/28    4   user1
    26  2016/12/28    4   user2
    3   2016/12/28    4   user2
    8   2016/12/28    4   user1
    1   2016/12/28    4   user1
    22  2016/12/28    4   user1
    26  2016/12/28    4   user2
    1   2016/12/28    4   user1
    7   2016/12/28    4   user2
    12  2016/12/28    4   user3
    23  2016/12/28    4   user3
    31  2016/12/28    4   user3
    2   2016/12/31    4   user1
    1   2016/12/31    4   user2
    27  2016/12/31    4   user2

What I want to do is visualize the counts by stacking by class and grouping between users with a label for the x axis, which is the dates.

+4
source share
1 answer

Yes, you can. Assuming you have data in pandas dataframe (df).

Here is an example in the bokeh documentation: Lines grouping bar

from bokeh.charts import Bar, output_file, show

p = Bar(df, label='date', values='count', stack='class',  group='user',
    )

output_file("bar.html")

show(p)
+3
source

Source: https://habr.com/ru/post/1665544/


All Articles