XLQP Gen1
ElementsData & charts

CreateStackedChart

Creates a stacked chart from multiple named series.

CreateStackedChart

What it does

Creates a stacked chart from multiple named series.

When to use it

Use it to compare totals and their component parts across rows or categories.

ElementFunction:CreateStackedChart(StackConfig)

local SpendingChart = Metrics:CreateStackedChart({
    Name = "Spending",
    Icon = "wallet",
    Prefix = "$",
    Series = {"Housing", "Food", "Transport"},
    Rows = {
        {Name = "Anna", Values = {8, 8, 4}},
        {Name = "Ben", Values = {12, 10, 8}},
        {Name = "Clara", Values = {16, 10, 10}},
        {Name = "David", Values = {20, 24, 6}}
    },
    Callback = function(segment)
        print(segment.RowName, segment.SeriesName, segment.Value)
    end
})

Behavior and return value

Store the returned controller or object when later code needs to update its state, call its methods, or close it.

Fields marked optional may be omitted. XLQP then uses the method’s built-in default or leaves that feature disabled.