diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-01-19 16:09:56 +0100 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2021-01-20 08:47:18 +0100 |
commit | 4f58e9aa62d29a31ff8df74bea75cb770a0d50ff (patch) | |
tree | 5a33233faf90fd7cd1a74c8e145ec34928a339d9 /stats/barseries.h | |
parent | 2e2019dea7087937d7bcc0e9bd2598d61a758b65 (diff) | |
download | subsurface-4f58e9aa62d29a31ff8df74bea75cb770a0d50ff.tar.gz |
statistics: render bar and pie labels onto fill color
The labels in bar an pie charts are realized as individual
QSG pixmap nodes with an alpha channel. Sadly, rendering
bright labels onto a transparent background gives very
ugly artifacts.
As a stop gap measure, until the problem is understood,
render on a background with the color of the pie slice
or bar.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/barseries.h')
-rw-r--r-- | stats/barseries.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/stats/barseries.h b/stats/barseries.h index 50ef1e72d..9f9586fe8 100644 --- a/stats/barseries.h +++ b/stats/barseries.h @@ -11,6 +11,7 @@ #include <memory> #include <vector> +#include <QColor> #include <QRectF> class ChartBarItem; @@ -86,8 +87,8 @@ private: bool isOutside; // Is shown outside of bar BarLabel(StatsView &view, const std::vector<QString> &labels, int bin_nr, int binCount); void setVisible(bool visible); - void updatePosition(bool horizontal, bool center, const QRectF &rect, int bin_nr, int binCount); - void highlight(bool highlight, int bin_nr, int binCount); + void updatePosition(bool horizontal, bool center, const QRectF &rect, int bin_nr, int binCount, const QColor &background); + void highlight(bool highlight, int bin_nr, int binCount, const QColor &background); }; struct SubItem { @@ -96,6 +97,7 @@ private: double value_from; double value_to; int bin_nr; + QColor fill; void updatePosition(BarSeries *series, bool horizontal, bool stacked, double from, double to, int binCount); void highlight(bool highlight, int binCount); |