so the quoted code is running through each of the intervals in the activity and picking out the label and average watts for the work intervals and saving them in their own array. (it then moves on to the plotting bits)
the options for what metrics you can pick are here
it sounds like you don’t want to look at the metrics aggregated into their intervals though and instead want the time series, in which case have a look at the activity stream models
best bet is probably to explore some charts already shared that look a bit like what you want and adapt them