Commit graph

2 commits

Author SHA1 Message Date
Berthold Stoeger
3b26f6a767 statistics: add a header file defining z-values
z-values determine the order in which objects on the chart are
painted. To reduce chaos, collect all z-values in a header file.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-01-02 11:04:03 -08:00
Berthold Stoeger
3a65b0f37f statistics: implement a legend box
For some chart (e.g. pie charts or stacked bar charts), we want
to display a legend. QtCharts' legend interface happens to be
private and therefore is of no use.

This introduces a legend box which is implemented using
QGraphicItems, which can be placed on top of QCharts. It's very
unfancy, but works for now. If there are too many items, not
all are shown. Currently, the legend is configured to fill
at most half of the width and half of the height of the chart.
This might need some optimization.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-01-01 21:10:10 +01:00