Skip to content

Add linear regression trend line to statistics #918

Merged
davidhealey merged 2 commits intodavidhealey:masterfrom
Frylen:StatsLinearRegression
Jul 16, 2025
Merged

Add linear regression trend line to statistics #918
davidhealey merged 2 commits intodavidhealey:masterfrom
Frylen:StatsLinearRegression

Conversation

@Frylen
Copy link
Copy Markdown
Contributor

@Frylen Frylen commented Jul 16, 2025

Adds a trend line for the statistics chart and displays the trend/slope the selected stat is following.

Preview:
2025-07-16_20-16
The trend line is the orange dashed line. It is calculated using the method of least squares. The resulting formula (y = mx + b) gets used to draw a line between x_0 and x_n (n = size of selected data set).
The slope/trend (m of the formula above) gets displayed in the timeline like the calculated average of the stat.

Conditions:

  • To display the trend line, it needs to be enabled in the settings.
  • There need to be at least 2 data points for the selected stat in the selected time frame.

This implements the feature request in #890.

Frylen added 2 commits July 16, 2025 20:14
Add a trend line in the statistics page chart using the method of least squares (simple linear regression). Feature is toggleable in the settings.
Add a text field in statistics timeline to display the slope/trend of the selected stat. Uses the same toggle as the trend line.
@davidhealey
Copy link
Copy Markdown
Owner

That all looks good, thanks!

@davidhealey davidhealey merged commit 78029a9 into davidhealey:master Jul 16, 2025
@Frylen Frylen deleted the StatsLinearRegression branch July 16, 2025 18:49
@Frylen Frylen restored the StatsLinearRegression branch July 16, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants