Live average or current average along a ride?

225 views
Skip to first unread message

Ignacio Sanz

unread,
Apr 2, 2026, 11:38:57 AMApr 2
to golden-cheetah-users
Hello, I would like to create a metric that shows the average of a metric up to that moment throughout a ride?
For example, for a 6 hour ride, that it shows the average speed when I had covered the first hour, the average after two hours, the average for three hours and so on...
Nowadays this is more or less what I see with TSS in the "stress" tab for cycling, I can see how TSS "acumulates" throughout the ride, is this possible for average power or speed for example?
Thanks

Ale Martinez

unread,
Apr 2, 2026, 12:01:43 PMApr 2
to golden-cheetah-users
Yes, the easiest way is to add a User Data curve to Activitiy chart as explained in https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_ChartTypes_Activities#user-data-curves,
in this case the formula in km/h can be something like: 3600*DISTANCE/SECS 

Joachim Kohlhammer

unread,
Apr 3, 2026, 4:05:42 AMApr 3
to golden-cheetah-users
I have a User Chart with formulas all like

{

relevant {

Data contains "P";

}


finalise {

xx <- samples(SECS);

s <- samples(POWER);

yy <- sapply(s, { sum(head(s, i)) / i; });

}


x { xx; }

y { yy; }

}


Ale Martinez

unread,
Apr 3, 2026, 5:01:41 AMApr 3
to golden-cheetah-users
El viernes, 3 de abril de 2026 a la(s) 5:05:42 a.m. UTC-3, tiefgara...@gmail.com escribió:
I have a User Chart with formulas all like

{

relevant {

Data contains "P";

}


finalise {

xx <- samples(SECS);

s <- samples(POWER);

yy <- sapply(s, { sum(head(s, i)) / i; });

this can be vectorized for better performance as: yy <~ cumsum(s)/xx;  

Joachim Kohlhammer

unread,
Apr 3, 2026, 8:32:17 AMApr 3
to golden-cheetah-users
This is awesome! The chart is now basically instant :)

Ignacio Sanz

unread,
Apr 7, 2026, 3:43:14 PMApr 7
to golden-cheetah-users
Thanks for your replies 3600*Distance/secs worked, and was easy to follow, but the other formula to show the "current average power at any time of the ride is producing no result at all
I am copying

{

relevant {

Data contains "P";

}


finalise {

xx <- samples(SECS);

s <- samples(POWER);

yy <- sapply(s, { sum(head(s, i)) / i; });

}


x { xx; }

y { yy; }

}


In the user data tab of the chart settings


Am i doing smething wrong?

Ale Martinez

unread,
Apr 7, 2026, 4:50:01 PMApr 7
to golden-cheetah-users
El martes, 7 de abril de 2026 a la(s) 4:43:14 p.m. UTC-3, ignaci...@gmail.com escribió:
Thanks for your replies 3600*Distance/secs worked, and was easy to follow, but the other formula to show the "current average power at any time of the ride is producing no result at all
I am copying

{

relevant {

Data contains "P";

}


finalise {

xx <- samples(SECS);

s <- samples(POWER);

yy <- sapply(s, { sum(head(s, i)) / i; });

}


x { xx; }

y { yy; }

}


In the user data tab of the chart settings


Am i doing smething wrong?



It is possible to do that as a User Data series, but you need to accumulate work as explained in https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_Special-Topics_Formula-Syntax-and-Expressions#existssymbol---since-v36 and divide by SECS in the last step to have average power.

Steve Edmonds

unread,
Apr 7, 2026, 5:26:25 PMApr 7
to golden-che...@googlegroups.com
Assuming I have understood your requirement correctly, following the discussion in this thread I have created a user chart with the following that plots average power (W) vs seconds. If this does not work for you it may relate to other aspects of the chart settings.

{

init {

xx<-c();

yy<-c();

count<-0;

}

relevant {

Data contains "P";

}

finalise {

# we just fetch samples at end

xx <- samples(SECS);

s <- samples(POWER);

yy <- cumsum(s)/xx;

}

x { xx; }

y { yy; }

}


Steve
--
_______________________________________________
Golden-Cheetah-Users mailing list
golden-che...@googlegroups.com
http://groups.google.com/group/golden-cheetah-users?hl=en
---
You received this message because you are subscribed to the Google Groups "golden-cheetah-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golden-cheetah-u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golden-cheetah-users/c2f5db95-d7d1-4553-80f2-0110c1268bcen%40googlegroups.com.

Steve Edmonds

unread,
Apr 7, 2026, 5:32:01 PMApr 7
to golden-che...@googlegroups.com
Just to add my assumption, I have assumed you are wanting a chart to show the data from an activity you have previously recorded, not an average to be displayed during a training session in the way Rouvy can display say average W/kg during a ride.

Ale Martinez

unread,
Apr 9, 2026, 8:12:25 AMApr 9
to golden-cheetah-users
El martes, 7 de abril de 2026 a la(s) 6:32:01 p.m. UTC-3, st...@edmondsfamily.co.nz escribió:
Just to add my assumption, I have assumed you are wanting a chart to show the data from an activity you have previously recorded, not an average to be displayed during a training session in the way Rouvy can display say average W/kg during a ride.

It is not the subject of this thread, but GoldenCheetah Train also allows to display real time averages for Power, Heart Rate, Speed and Cadence: https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_ChartTypes_Train#telemetry

Ignacio Sanz

unread,
Apr 15, 2026, 2:48:13 PM (12 days ago) Apr 15
to golden-cheetah-users
I haven´t been able to find it, which keyword should I use, or what´s the name?
Thanks very much in advance

Ale Martinez

unread,
Apr 15, 2026, 3:55:26 PM (12 days ago) Apr 15
to golden-cheetah-users
El miércoles, 15 de abril de 2026 a la(s) 3:48:13 p.m. UTC-3, ignaci...@gmail.com escribió:
I haven´t been able to find it, which keyword should I use, or what´s the name?

Lets summarize this thread:

1) In Train view you can configure a Dial to show real time "Average Power":

Screenshot 2026-04-15 164910.png
 
2) On Activity chart you can plot Average Power as a User Data series with a formula like
{
  work <- work + (POWER * RECINTSECS);
  work/1000/SECS;
}

3) On a User Chart you can plot Average Power series using the following fragment:

{

  relevant {

    Data contains "P";

  }

  finalise {

    # we just fetch samples at end

    xx <- samples(SECS);

    yy <- cumsum(samples(POWER)  )/xx;

}

x { xx; }

y { yy; }

}


Hope this help, if you have more doubts please read de documentation before to ask further questions.

Cheers, Ale.

Joachim Kohlhammer

unread,
Apr 15, 2026, 3:59:05 PM (12 days ago) Apr 15
to golden-cheetah-users
Attachment is the chart I use in Activities View to see the averages for each point in time of a ride (can directly be imported). Maybe it can help and serve as a starting point.
Averages over time.gchart

Steve Edmonds

unread,
Apr 15, 2026, 8:36:36 PM (11 days ago) Apr 15
to golden-che...@googlegroups.com
Do you mean find how to add a chart. This is covered in the WIKI, in activities clicking the + in the right of the top bar and selecting a user chart.
I did notice the other day something that seemed strange. To add a chart I clicked +, selected user chart, I could give it a name but that was all and I had to save it at that point and then select it in the top bar to edit the settings and add the formula.

Steve

marcen

unread,
Apr 16, 2026, 11:39:24 AM (11 days ago) Apr 16
to golden-cheetah-users

For the “Elevation Delta” data series, “sapply” can be omitted.


from:

yy <- sapply(alt, x - alt[0]);

to:

yy <- alt - alt[0];

Ignacio Sanz

unread,
Apr 18, 2026, 3:49:23 PM (9 days ago) Apr 18
to golden-cheetah-users
i am sorry I understood you had created a chart and uploaded it to the cloud for anyone to download and I was trying to find it as such. I have now added a chart myself, thanks


El martes, 7 de abril de 2026 a las 23:26:25 UTC+2, Steve Edmonds escribió:

Ignacio Sanz

unread,
Apr 18, 2026, 3:58:19 PM (9 days ago) Apr 18
to golden-cheetah-users
Thanks for summarizing, everything is understood now, sorry to bother
Reply all
Reply to author
Forward
0 new messages