statistics: fix chart features: regression line and median/mean

The coordinates of these were calculated when creating the feature.
This is wrong, because the min/max values of the axes can change
on resize to get "nice" number. Therefore, recalculate after resizing.
This means that the general "LineMarker" class has to be split into
two classes, one for regression lines and one for median/mean
markers.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-06 14:17:51 +01:00 committed by Dirk Hohndel
parent ab324ed769
commit 405e6b6b69
4 changed files with 70 additions and 34 deletions

View file

@ -52,6 +52,12 @@ std::pair<double, double> StatsAxis::minMax() const
return { min, max };
}
std::pair<double, double> StatsAxis::minMaxScreen() const
{
return horizontal ? std::make_pair(zeroOnScreen, zeroOnScreen + size)
: std::make_pair(zeroOnScreen, zeroOnScreen - size);
}
void StatsAxis::setRange(double minIn, double maxIn)
{
min = minIn;