XLQP Gen1
ElementsData & charts

CreateStat

Creates an animated statistic with optional delta and duration.

CreateStat

What it does

Creates an animated statistic with optional delta and duration.

When to use it

Use it for a single KPI that may change and should emphasize the new value.

ElementFunction:CreateStat(StatConfig)

local CurrencyStat = Metrics:CreateStat({
    Name = "Currency",
    Icon = "coins",
    Value = "$21",
    Delta = "+19%",
    Duration = 0.55,
    Callback = function(value, delta)
        print("currency", value, delta)
    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.