Time spent by % gradient chart

Would it be possible to get a chart with the time spent by % gradient chart, that would be like the HR chat :
For example on a 4 hours ride:

  • Above 0% : 50km
  • Above 1% : 30km
  • Above 2% : 20m
  • Above 10% : 2km
    etc.

Thank you!

@david any comment on the feasibility and desire to implement such feature?

Thank you!

Can you just tell me if this is feasible and it you plan do implement it someday? Or if I have to find another way to get this information.

Thank you :pray:t2:

Sorry it’s hard to keep up with these forums! It is definitely possible and could be done using a custom activity chart.

1 Like

Hi David, is it possible to do this in aggregate over time? I saw this screenshot on another blog but I can’t see where they would’ve found this on Intervals.

You can get close using the activity histograms:

If you click the dot dot dot menu you can set the min and the max:

1 Like

Thanks David! This works at an individual activity level, but my question was if it’s possible to aggregate across activities. Basically, I’m curious how much of the year I’ve spent say… above 10% gradient.

1 Like

This would be very handy.
I coach a lot of ultra trail runners and seeing how much time spent in certain gradient zones over a year or season would be a step up on just looking at total elevation.

2 Likes

Right now you would need to make a custom activity field for each gradient zone, each computed from the gradient stream, then plot those on the /fitness page. You could get monthly stats at least.

I really need to implement “custom zones for any trace” or something for this use case.

Thanks David! I’ve never used streaming data directly, do you have an example I can start with?

I could only find the example you provided on the blog, but that seems to be for an Activity Stream, not an Activity Field. If you just have a similar example I have enough beginner coding to figure out the rest.

Add a custom activity field (click “Custom” under the activity timeline chart). This script will find time spent at least 6% but less than 8% (you get the idea).

out: {
  let data = icu.streams.grade_smooth
  if (!data) break out
  let secs = 0, delta = activity.icu_median_time_delta
  for (let g of data) {
    if (g >= 6 && g < 8) secs += delta
  }
  secs
}

Set the “Convert” option to display the seconds nicely:

1 Like

Thanks David! I think this will work for now. Long-term, a % of total to standardize fluctuation in ride-time would make this better, but this will do just fine for now! Here’s a view I created as inspiration (trailing 7 day totals)

1 Like