Skip to content

Categorical Line Chart

CategoricalLineChartStrategy plots lines over an ordered categorical X axis (e.g. fiscal quarters, ordinal labels). Unlike LineChartStrategy, the X axis is not calendar-based.

Constructor

from orama.strategies.categorical_line import CategoricalLineChartStrategy

strategy = CategoricalLineChartStrategy(
    fields_metadata=fields_metadata,
    x_variables=["year", "quarter"],        # list[str] — ordered categorical X axis
    aggregation=Aggregation(name="revenue", function="sum", field="revenue"),
    series_variable="region",               # str | None — optional series split
    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
    x_label=None,                           # str | None — X-axis label
    value_label=None,                       # str | None — Y-axis label for the value
    series_label=None,                      # str | None — legend title (when series_variable is set)
    show_legend=True,                       # bool — show the figure legend (no effect in ridgeline mode)
)

Supported colors

Selectors: ColorSelectorStrategy, ColorSelectByCategoryName.

Assigners: ColorAssignerByCategory.