How can I access the best maximum pulses in the last 42 days? I don’t know if this is possible
Yes you can:
Example pulling the athletes MMP power curve for the last 42 days (from activity date) and extracting best 5m power:
let mmp42d = icu.bestPower['42d']
let best5mWatts = mmp42d.getWatts(5 * 60)
Sorry I just realised you were probably looking for heart rate data. You can do:
let hr42d = icu.bestHR['42d']
let best5mBpm = hr42d.getBpm(5 * 60)
Everything available is listed here.
Any chance to access fit file messages as in custom activity fields?
Is it possible to code custom charts for the fitness tab too?
You can already do this: Computed fields from fit file messages
Not yet but I am planning to add that soon.
Hi,
How do I access the athlete object’s threshold HR value in Javascript for a custom activity chart on Intervals.icu rendered with Plotly ?
Thanks.
Should be
icu.sportSettings.lthr
Has there been any change in plotly?
This is what appears when I generate a new chart. In this example, it is one that I already have and can see perfectly, but when I copy and paste the code into another chart to test it, I cannot see it.
I could imagine that this is because of global variables.
If you define global variables within your script, they can’t be declared again in another one on the same page.
Therefore I put my scripts always in another scope with brackets around the whole script:
{
…
}
![]()
and the threshold power and threshold pace for running ?
Not due to global variables. In fact if you see the image you can see them perfectly, it’s something related to plotly, I don’t know if the version has been changed, but the same graphic if I set it to zero it doesn’t look correct. Look at the images, the graph is displayed but badly.
icu.sportSettings.threshold_pace
icu.sportSettings.ftp
You can that and more look up there:
File: dist/index.d.ts
Are there any errors, when you press the play button inside the script? I would say, both scripts probably should use the same (plotly) version, even if it was updated.
The code is exactly the same, the chart you see I had a long time ago and the one you don’t see I just copied the code and copied it into a new one
For the global variable icu.sportSettings.ftp, it matches the value entered.
For the global variable icu.sportSettings.threshold_pace, it does not match.
4:08 min/km as a parameter equals 4.133 minutes, but the query to display the value returns 4.032258033752441.
The unit is in [m/s]. If you want to convert it in [min/km], you have to calculate:
data = (60/3.6)/icu.sportSettings.threshold_pace;
// 60/3.6/4.032258033752441 = 4.1333333648681645
Many thanks @R2Tom
How do I reference custom fields added to the sport in settings, in a custom chart?
You can access them with activity.
You have to reprocess activities to copy them to old workouts.

