output_file("bar_stacked.html")
time = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
product = ["product_A","product_B"]
colors = ["#718dbf", "#e84d60"]
data = { 'time': time,
'product_A' : [20, 35, 30, 35, 27, 43, 24, 34, 14, 27, 22, 50],
'product_B' : [25, 32, 34, 20, 25, 34, 54, 23, 43, 33, 27, 29]
}
p = figure(x_range=time, plot_height=250, title="Sales of Products",
toolbar_location=None, tools="hover")
p.vbar_stack(product, x='time', width=0.9, color=colors, source=data,
legend_label=product)
p.y_range.start = 0
p.x_range.range_padding = 0.1
p.xgrid.grid_line_color = None
p.axis.minor_tick_line_color = None
p.outline_line_color = None
p.legend.location = "top_left"
p.legend.orientation = "horizontal"
show(p)