diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-01-01 21:35:56 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-01-02 11:04:03 -0800 |
commit | 31da03770164db83787fcb63c2d3a033c4c48417 (patch) | |
tree | 63fba9e2fcd1cae0b56b1664a706b87f1b047589 /stats/CMakeLists.txt | |
parent | 3b26f6a767595012bfe561f790404719f8580746 (diff) | |
download | subsurface-31da03770164db83787fcb63c2d3a033c4c48417.tar.gz |
statistics: implement axes
Implement five kinds of axes:
- ValueAxis: a standard axis for plotting numerical linear data.
- CountAxis: a ValueAxis for plotting counts of dives.
- CategoryAxis: an axis for plotting discrete variables without
any notion of distance.
- HistogramAxis: an axis for plotting bins with a numeric value.
- DateAxis: a HistogramAxis that formats dates.
The axes derive from a common virtual base class that defines
a small interface, notably, returning the minimum and maximum
displayed value and redrawing the axis.
The mapping and painting is performed by QtCharts' axes. On
the one hand, using QtCharts turned out to be too inflexible.
On the other hand it allowed us to quickly prototype the charts.
Ultimately, we should do our own drawing of the axis.
As a testament to the inflexibility, QtCharts' axes do not
allow for repeated labels is needed for quarter-based date
charts (year, Q2, Q3, Q4, year, Q2, Q3, ...). Therefore the
code disambiguates labels by adding unicode zero-width spaces.
Wonderful.
When omitting labels due to space reasons, the histogram
axis attempts to show "preferred" labels. In the quarter
example above, it tries to show full years.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/CMakeLists.txt')
-rw-r--r-- | stats/CMakeLists.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/stats/CMakeLists.txt b/stats/CMakeLists.txt index a03ff0c1a..c8ab86997 100644 --- a/stats/CMakeLists.txt +++ b/stats/CMakeLists.txt @@ -7,6 +7,8 @@ include_directories(. set(SUBSURFACE_STATS_SRCS legend.h legend.cpp + statsaxis.h + statsaxis.cpp statscolors.h statscolors.cpp statsvariables.h |