Stacked Bar Chart#

Bar charts can be stacked by specifying the is_stacked argument on series.

  • Each series on the axis will be stacked on top of each other

  • Negative values will move down on the y-axis and offset positive values



import pandas as pd

from visualization_toolkit.helpers.plotly import chart, axis, series


fig = chart(
    pdf,
    x_axis=axis(column_name="fiscal_qy", label="Fiscal Quarter"),
    y1_axis=axis(label="Downloads", axis_type="number", axis_min=0, axis_max=250000),
    chart_series=[
        series(
            column_name="ucan",
            label="UCAN",
            color="dark-blue",
            mode="bar",
            is_stacked=True,
        ),
        series(
            column_name="china",
            label="China",
            color="light-blue",
            mode="bar",
            is_stacked=True,
        ),
    ],
)

fig

Total running time of the script: (0 minutes 0.020 seconds)

Gallery generated by Sphinx-Gallery