profile: use dynamic distances between labels on chart

Use variable intervals for printing temperature and heart
beat labels. Obviously, so that the labels don't become
sparse on zooming, but also to make them not too crowded
on mobile / small screens.

This doesn't work for depth labels, because these labels
use data provided from the profile.c core that doesn't
know about the size of the chart.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-10-16 20:43:19 +02:00 committed by Dirk Hohndel
parent 5c83fcd647
commit efc89b9d9c
3 changed files with 23 additions and 8 deletions

View file

@ -45,6 +45,9 @@ public:
double width() const; // only for vertical axes
double height() const; // only for horizontal axes
// The minimum space between two labels on the plot in seconds
int getMinLabelDistance(const DiveCartesianAxis &timeAxis) const;
private:
Position position;
bool inverted; // Top-to-bottom or right-to-left axis.