We (tx @ryandev ) have added support for custom formulas on custom charts on the /fitness page. These are simple math expressions and (hopefully!) easy for non-software developers to write. Here is a BMI chart:
Choose “Custom Charts” → “Add” → “Chart” to add a new custom chart. Then do “Add Plot” and search for “Formula”:
Click the little pencil under “Formula” on the table to exit the expression. Choose “Add Plot” to insert the expression for weight into the formula:
The athlete is available as a variable for fields like ‘height’ so you can complete the BMI formula:
The pre days field specifies how many days of data should be included before the start of the date range. This is useful for formulas that compute moving averages and so on. Pre days will be at least this number and maybe more depending on other plots and charts.
There many built in functions, some of which are on the “Function” drop down. For a complete list please see this list of mathjs functions.
If you select a plot with argument (e.g. the duration for “Best Power”) then these are prompted for and inserted into the expression:
Advanced Usage
The expressions are evaluated by mathjs and most functionality is available in Intervals.icu.
The formula is evaluated once for each day in the date range. You can assign values to variables and these carry over from one day to the next (0 for the first day). You can create multi line expressions where the value of the expression is the value from the last line.
Here is the exponentially weighted moving average for fitness (CTL):
f = exp(-1 / 42)
v = v * f + (fitness_load ?? 0) * (1 - f)
Note the use of the ?? operator to convert null or undefined fitness_load (no training on that day) into zero.
I used the dot dot dot menu for the formula plot to put it on the same axis as fitness:
To get this to match the built in “Fitness” plot you need to change pre days to fetch more data before the start of the date range.




















