mirror of
https://github.com/beestat/app.git
synced 2025-07-09 03:04:07 -04:00
Fixed #317 - Metric resist balance point is sometimes wrong
Added more precision to profile linear trendline generation.
This commit is contained in:
parent
d5e202c80b
commit
e3a4e015e3
@ -960,8 +960,8 @@ class profile extends cora\api {
|
||||
$intercept = (($sum_y) - ($slope * $sum_x)) / ($n);
|
||||
|
||||
return [
|
||||
'slope' => round($slope, 2),
|
||||
'intercept' => round($intercept, 2)
|
||||
'slope' => round($slope, 4),
|
||||
'intercept' => round($intercept, 4)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -145,6 +145,9 @@ beestat.component.card.temperature_profiles.prototype.get_data_ = function() {
|
||||
/**
|
||||
* Get a linear trendline from a set of data.
|
||||
*
|
||||
* IMPORTANT: This exists in the profile already but it's wrong to use it
|
||||
* directly as it's not right for Celsius.
|
||||
*
|
||||
* @param {Object} data The data; at least two points required.
|
||||
*
|
||||
* @return {Object} The slope and intercept of the trendline.
|
||||
|
Loading…
x
Reference in New Issue
Block a user