Hi everyone!
is it possible to combine a bar and a curve plot using holoviews?
this is my example
tuple = [('03/22/2021', 'Allocated (hrs/wk)', 4.0),
('03/29/2021', 'Allocated (hrs/wk)', 10.0),
('04/05/2021', 'Allocated (hrs/wk)', 3.0),
('04/12/2021', 'Allocated (hrs/wk)', 8.0),
('04/19/2021', 'Allocated (hrs/wk)', 10.0),
('04/26/2021', 'Allocated (hrs/wk)', 2.0),
('05/03/2021', 'Allocated (hrs/wk)', 3.0),
('03/22/2021', 'Billed (hrs/wk)', 4.0),
('03/29/2021', 'Billed (hrs/wk)', 9.0),
('04/05/2021', 'Billed (hrs/wk)', 2.0),
('04/12/2021', 'Billed (hrs/wk)', 6.0),
('04/19/2021', 'Billed (hrs/wk)', 8.0),
('04/26/2021', 'Billed (hrs/wk)', 3.0),
('05/03/2021', 'Billed (hrs/wk)', 4.0)]
plot_data = [
('2021.03.22', 4.0),
('2021.03.29', 7.0),
('2021.04.05', 6.5),
('2021.04.12', 5.5),
('2021.04.19', 9.0),
('2021.04.26', 6.0),
('2021.05.03', 2.5)]
group = "4f0d885"
ymax = 20
plot = hv.Bars(tuples, ["date", "hours_type"], ["hours"]).opts(
title=f"{group}",
stacked=False,
multi_level=False,
height=400,
width=600,
active_tools=["pan"],
ylim=(0, ymax),
)
curve_plot = hv.Curve(plot_data, 'date', "Allocated (hrs/wk)").options(
title=f"{group}",
height=400,
width=600,
active_tools=["pan"],
ylim=(0, ymax),
)
display(plot)
display(curve_plot)
it works fine, but if I try to display (using jupyter notebook) display(plot * curve_plot)
, it doesn’t work:
ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 2 dimension(s) and the array at index 1 has 1 dimension(s)
:Overlay
.Bars.I :Bars [date,hours_type] (hours)
.Curve.I :Curve [date] (Allocated (hrs/wk))
does someone has any idea about this problem and how to fix it? thanks!