Note
Go to the end to download the full example code.
Use Atlas theme for charts#
Charts will default to using the YD_CLASSIC_THEME that is meant to replicate YD report styles.
However themes can be swapped. This can be changed using the
themeargument ofchartA new
ATLAS_THEMEis available when creating charts that are intended for customer facing experiences.A few adjustments are made in the
ATLAS_THEMEto better suit rendering charts embedded in a browser vs an emailed report
import pandas as pd
from visualization_toolkit.helpers.plotly import chart, axis, series
from visualization_toolkit.helpers.plotly.theme import ATLAS_THEME
fig = chart(
pdf,
x_axis=axis(column_name="fiscal_qy", label="Fiscal Quarter"),
y1_axis=axis(label="Downloads", axis_type="number", axis_min=0),
chart_series=[
series(
column_name="ios_dl_idx",
mode="bar",
is_stacked=True,
pivot_column_name="region",
include_all_categories=True,
# sort categories by total downloads using the ios_dl_idx column
# in descending order (the "-" indicates descending)
category_sort_column_name="-ios_dl_idx",
),
],
theme=ATLAS_THEME,
)
fig
Total running time of the script: (0 minutes 0.031 seconds)