Note
Go to the end to download the full example code.
Combo Chart on Same Axis#
Combo charts that mix line and bar series can share the same axis. This is the behavior by default if location is not specified for a series, or shares the same value with other series locations.
import pandas as pd
from dateutil.relativedelta import relativedelta
from visualization_toolkit.helpers.plotly import chart, axis, series
fig = chart(
pdf,
x_axis=axis(
column_name="day",
axis_type="date",
label="Week Ending",
tick_interval=relativedelta(days=7 * 6),
),
chart_series=[
series(
column_name="abnb_gbv_share",
label="ABNB GBV Share",
mode="lines",
color="dark-blue",
),
series(
column_name="vrbo_gbv_share",
label="VRBO GBV Share",
mode="bar",
color="light-blue",
),
],
y1_axis=axis(
axis_type="percent",
axis_min=0,
axis_max=1,
tick_format="0.0%",
),
)
fig
Total running time of the script: (0 minutes 0.019 seconds)