Read a stats chart
get_stats_chartRead one statistics breakdown aggregated over a date window (the /statistic page data).
chart: an id from list_stats_charts, e.g. 'zones_duration_heartrate' (time in heart-rate
zones), 'sport_duration' (volume by sport). date_from / date_to: 'YYYY-MM-DD' window
(default: the last 365 days). athlete: a managed athlete's usr_… handle; omit for yourself.
sport: an optional spt_… catalog handle to filter to one exact sport.
Returns rows ({label, value, color}, value is seconds for a duration/zones chart, a
count of trainings, or the measure unit (distance, elevation_gain, kilojoules)) and total, the sum of
the rows. A count chart counts the trainings carrying its dimension: sport_count every
confirmed training of the window (competitions included, so it is the fill-rate denominator;
a real/trainings listing hides competitions), rpe_count only those whose rpe is set (a null
rpe is skipped, 0 counts as N/A), feeling_count every training (a missing feeling is the
N/A row), tag_count counts a training once per tag it carries. For a month-by-month
evolution, call this on several sub-windows and compare; a single call is the aggregate
over the whole window.
RPE/feeling rows also carry their numeric note in rpe/feeling (null for N/A).
Use the numeric notes and counts for distributions; exclude null notes from statistics.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chart | Yes | ||
| sport | No | ||
| athlete | No | ||
| date_to | No | ||
| date_from | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||