Skip to content

Boxplot

BoxplotChartStrategy renders a statistical distribution chart showing Q1, median, Q3, and computed IQR fences per category. An optional overall boxplot can be added.

Constructor

from orama.strategies.boxplot import BoxplotChartStrategy

strategy = BoxplotChartStrategy(
    fields_metadata=fields_metadata,
    category_variables=["region"],
    value_variable="revenue",       # str — a NonDerivedNumericalVariable field
    horizontal=False,
    overall_category_name="",       # str — label for an optional overall boxplot, or ""
    display_mean=False,             # bool — show mean marker
    display_sd=False,               # bool — show standard deviation (requires display_mean)
    color_rules=None,
    title=None,                     # str | None
    subtitle=None,                  # str | None
    caption=None,                   # str | None
    description=None,               # str | None — interpretive text (not in figure)
    storytelling_context=None,      # str | None — narrative goal / target audience
    category_label=None,            # str | None — axis label for the category
    value_label=None,               # str | None — axis label for the value
    show_legend=True,               # bool — show the figure legend
)

get_query_params() aggregates Q1, median, Q3, mean, standard deviation, min, and max. When overall_category_name is set, a second "overall" query is added.

Supported colors

Selectors: ColorSelectorStrategy, ColorSelectByCategoryName, ColorSelectValuesBelow, ColorSelectValuesAbove, ColorSelectMaxValue, ColorSelectMinValue, ColorSelectValuesBelowMean, ColorSelectValuesAboveMean.

Assigners: ColorAssignerByCategory, ColorAssignerByValue.