XData Gears User chart

401 views
Skip to first unread message

Jérôme launay

unread,
Jul 16, 2021, 4:53:55 PM7/16/21
to golden-cheetah-users
Hello,
In my raw data I can find in Xdata "GEARS" with columns "FRONT" 53 or 39 and "REAR" 11-28.

I would like to create 2 charts, one showing which Front-Rear combinaison I use the most in percent (for exemple 52-15 -> 25%) and another one showing which combinaison I''m on during an activitie.

I tried a lot of thing but could not find a way to do it for neither of the two, I can't even display anything with this data on a graph.

Have any of you done this before and could help me?

Thanks a lot for your help,
Regards,
Jérôme

Ale Martinez

unread,
Jul 17, 2021, 9:33:29 AM7/17/21
to golden-cheetah-users
El viernes, 16 de julio de 2021 a la(s) 17:53:55 UTC-3, launayj...@gmail.com escribió:
Hello,
In my raw data I can find in Xdata "GEARS" with columns "FRONT" 53 or 39 and "REAR" 11-28.

I would like to create 2 charts, one showing which Front-Rear combinaison I use the most in percent (for exemple 52-15 -> 25%) and another one showing which combinaison I''m on during an activitie.

I tried a lot of thing but could not find a way to do it for neither of the two, I can't even display anything with this data on a graph.

To access the data you can use front<-xdata("GEARS", "FRONT"), rear<-xdata("GEARS", "REAR") and secs<-xdata("GEARS", secs) as documented in https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_Special-Topics_Formula-Syntax-and-Expressions#xdataxdataname-xdataseries--km--secs---since-v36 

This vectors can be plotted as line series in User Charts similar to samples() in the examples.

If you want to combine both in a single number you could use development, i.e. front/rear, or shift decimals s.t. front*100+rear to get 5311 for example.

To build a histogram of combination usages you could use a bar or pie chart with the help of https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_Special-Topics_Formula-Syntax-and-Expressions#aggregating

Have any of you done this before and could help me?
 
Another user has contributed a nice looking chart you can try, but I have not tested it: https://groups.google.com/g/golden-cheetah-users/c/xHgiARwsB-Y/m/QN8ZfOkDAwAJ 

Likely searching the forum and CloudDB you find other examples.

Jérôme launay

unread,
Jul 22, 2021, 8:40:22 PM7/22/21
to golden-cheetah-users
Thanks a lot for your answer, il will help a lot.
The problem is I'm using GC on Archlinux (https://aur.archlinux.org/packages/golden-cheetah-git/) and I can't enable cloudDB, in the config file gcconfig.pri I uncommented cloudDB = active, I now find "download chart" in the "view" menu but it give me a 404 error and I do not know the values for GC_CLOUD_DB_BASIC_AUTH and GC_CLOUD_DB_APP_NAME needed to use the public cloudDB instance. I am still looking for a solution to this problem.
In the meantime I will try it myself with the information you gave me, thank you.
Message has been deleted

Ale Martinez

unread,
Jul 22, 2021, 9:10:12 PM7/22/21
to golden-cheetah-users
El jueves, 22 de julio de 2021 a la(s) 21:40:22 UTC-3, launayj...@gmail.com escribió:
Thanks a lot for your answer, il will help a lot.
The problem is I'm using GC on Archlinux (https://aur.archlinux.org/packages/golden-cheetah-git/) and I can't enable cloudDB, in the config file gcconfig.pri I uncommented cloudDB = active, I now find "download chart" in the "view" menu but it give me a 404 error and I do not know the values for GC_CLOUD_DB_BASIC_AUTH and GC_CLOUD_DB_APP_NAME needed to use the public cloudDB instance. I am still looking for a solution to this problem.

Jérôme launay

unread,
Jul 22, 2021, 9:29:19 PM7/22/21
to golden-cheetah-users
I've looked at this FAQ before but don't want to use a binary version. I prefer to use one compiled from source using the PKGBUILD in AUR (for dependencies etc ...)

Jérôme launay

unread,
Jul 22, 2021, 9:32:15 PM7/22/21
to golden-cheetah-users
With your help I'm now able to draw a Line Chart, I will read about aggregating in order to play with bar or pie chart.

Jérôme launay

unread,
Aug 2, 2021, 10:04:47 AM8/2/21
to golden-cheetah-users
I'm making good progress but I still have some problems.
I used the wiki to understand how aggregations work but I can't find an example (even basic) of a pie chart.

Since I'm on Archlinux I use the git version of GC compiled from AUR but I'm unable to build it with support for CloudDB.
Is it possible without using a binary version?
If so, what do I need to fill in the gcconfig.pri file for GC_CLOUD_DB_BASIC_AUTH and GC_CLOUD_DB_APP_NAME?

Ale Martinez

unread,
Aug 2, 2021, 12:47:21 PM8/2/21
to golden-cheetah-users
El lunes, 2 de agosto de 2021 a la(s) 11:04:47 UTC-3, launayj...@gmail.com escribió:
I'm making good progress but I still have some problems.
I used the wiki to understand how aggregations work but I can't find an example (even basic) of a pie chart.

PieChart.PNG
 
Since I'm on Archlinux I use the git version of GC compiled from AUR but I'm unable to build it with support for CloudDB.

You can use the binary version on ArchLinux if you want.
 
Is it possible without using a binary version?

No, as I already explained to you, and it is documented in the wiki.

Jérôme launay

unread,
Aug 2, 2021, 1:00:41 PM8/2/21
to golden-cheetah-users
Thanks for the example, I understand better now how to make a pie chart.
Thanks also for the clarification, you had indeed sent me a link to the wiki that explained how to install GC but I did not know if it was possible to have CloudDB support with a version compiled from source, it is now very clear.

Jérôme launay

unread,
Aug 3, 2021, 5:05:20 PM8/3/21
to golden-cheetah-users
With your and Mark's help I made the following pie chart (1st for Front gear, 2nd and 3rd for time spent on small/big front by rear, last one is time spent by gears combination).

2021-08-03_22-44.png

It look like I cannot attach the code so if anyone wants to check it because as I'm a beginner I'm really not sure it's correct I'll link it at the end of the message.
Some parts are not "clean" (secs to duration, filtering values...)

Thank you all again for your wonderful work on GC and for your help.
Feel free to tell me if I've done anything wrong or if something can be done in a better way.

Links for the charts code:



Jérôme launay

unread,
Aug 4, 2021, 7:07:35 PM8/4/21
to golden-cheetah-users
I have corrected the transformation from timestamp (seconds) to duration.
The shift on the vector was in the wrong direction (I have to take the next value and not the previous one to have a duration)

gearsecs <- xdata("GEARS", secs);

# secs to duration

gearsecs2 <- gearsecs;

append(gearsecs2,gearsecs[length(gearsecs)-1],length(gearsecs2)); # repeat last at the end to shift indexes

remove(gearsecs2, 0,1); # remove first to have same length

duration <- gearsecs2 - gearsecs;

I am now looking for a way to discard the values for which the activity is paused.

Jérôme launay

unread,
Aug 4, 2021, 9:31:31 PM8/4/21
to golden-cheetah-users
I finally have a version that works according to my tests and returns the same values as the one given by the di2stats website.
The code may not be perfect (there should be a simpler way) but it detects pauses in the activity, filters data errors.
Here is the code for anyone who is interested <link here>.

Edoardo Stecconi

unread,
Sep 10, 2021, 6:03:49 AM9/10/21
to golden-cheetah-users

can you attach the chart file here?
tk's 
Edoardo

Jérôme launay

unread,
Sep 22, 2021, 8:12:10 AM9/22/21
to golden-cheetah-users
Sorry for the late reply, i only just saw the post. Don't hesitate to tell me if you see a mistake
Shimano DI2.gchart

marcen

unread,
Aug 9, 2025, 12:11:16 PMAug 9
to golden-cheetah-users
Perhaps someone has a tip on how to use XDATA(‘GEARS’, ‘REAR’, repeat) in a user chart? When I use only yy <- XDATA(“GEARS”, ‘REAR’, repeat), the return value is only 0 or 1, meaning that it is available or not available in the selected unit. I thought it would give the same result as in Python with d = list(GC.xdata(‘GEARS’, ‘REAR’, join="repeat") )
print(d), where the Xdata values for the respective sections in the unit are repeated.  I wanted to use this to determine the pause time when the sprocket is not moving with speed from the unit. Thank you for your help.

Ale Martinez

unread,
Aug 9, 2025, 12:57:48 PMAug 9
to golden-cheetah-users
El sábado, 9 de agosto de 2025 a la(s) 1:11:16 p.m. UTC-3, marcen escribió:
Perhaps someone has a tip on how to use XDATA(‘GEARS’, ‘REAR’, repeat) in a user chart? When I use only yy <- XDATA(“GEARS”, ‘REAR’, repeat), the return value is only 0 or 1, meaning that it is available or not available in the selected unit. I thought it would give the same result as in Python with d = list(GC.xdata(‘GEARS’, ‘REAR’, join="repeat") )
print(d), where the Xdata values for the respective sections in the unit are repeated.  I wanted to use this to determine the pause time when the sprocket is not moving with speed from the unit. Thank you for your help.

To use XDATA you need to put it inside the sample method and build the vector yourself if you need one, as explained in https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_Special-Topics_Working-with-User-Charts#iterating-with-sample, the alternative is to use lower case xdata to get the full vector at once. 

marcen

unread,
Aug 9, 2025, 2:27:35 PMAug 9
to golden-cheetah-users
Thank you for the hint. I geht the vector with: 

init { xx <- c(); yy<- c(); }


sample {

append(yy, XDATA("GEARS","REAR", repeat ));

append(xx, SECS);

}


I thought xdata("GEARS", "REAR") only specified the times when shifting occurred.


Reply all
Reply to author
Forward
0 new messages