Extended custom formula functionality for non-numerical fields

Hi @david and @ryandev ,

While trying to use custom formulas on the fitness charts to create something similar to a PB progression chart, I noticed that fields that non-numerical fields are not working.

Using the example of my previous thread ( How to create a fitness chart for best pace ever until each date? ):

  • max_steps = max(max_steps, steps ?? 0) works as expected and returns the maximum value recorded until the corresponding date.
  • max_pace = max(max_pace, best_pace(1000, MINS_KM) ?? 0) does not work, but also does not give an error or value. It just does not do anything at all.

With the help of @MedTechCD, we found out that this applies to fields that are not numerical (e.g., pace, which are expressed with time units).

Therefore, it would be interesting to modify the implementation of the formulas so that these fields can also be used. This will open possibilities for doing custom formulas using this variables (e.g., PB progression charts, color coding paces or speeds based on how close they are to previous PBs, etc.)

On the other hand, if this is not on your plans, I think modifying the list of available plots would be necessary. It is quite confusing to get access to options that will not work.

Thanks for your work developing this app and I hope this is easy to implement :slight_smile: