diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-01-14 09:48:44 +0100 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2021-01-20 08:47:18 +0100 |
commit | 218c844ad4fa3f562c375b97694025f6cdaa3ca1 (patch) | |
tree | a09ddbcc1c09d04d89691a1ce0980d99950d6675 /stats/statsview.h | |
parent | 790d2b2ddb36fd39fe8f002290288603ba1f0065 (diff) | |
download | subsurface-218c844ad4fa3f562c375b97694025f6cdaa3ca1.tar.gz |
statistics: convert HistogramMarkers to QSGNodes
This is in analogy to the quartile markers.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/statsview.h')
-rw-r--r-- | stats/statsview.h | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/stats/statsview.h b/stats/statsview.h index 073a200fd..aad9ec977 100644 --- a/stats/statsview.h +++ b/stats/statsview.h @@ -24,6 +24,7 @@ class CategoryAxis; class ChartItem; class CountAxis; class HistogramAxis; +class HistogramMarker; class QuartileMarker; class StatsAxis; class StatsGrid; @@ -136,18 +137,8 @@ private: RegressionLine(const struct regression_data reg, QBrush brush, QGraphicsScene *scene, StatsAxis *xAxis, StatsAxis *yAxis); }; - // A line marking median or mean in histograms - struct HistogramMarker { - std::unique_ptr<QGraphicsLineItem> item; - StatsAxis *xAxis, *yAxis; - double val; - bool horizontal; - void updatePosition(); - HistogramMarker(double val, bool horizontal, QPen pen, QGraphicsScene *scene, StatsAxis *xAxis, StatsAxis *yAxis); - }; - void addLinearRegression(const struct regression_data reg, StatsAxis *xAxis, StatsAxis *yAxis); - void addHistogramMarker(double pos, const QPen &pen, bool isHorizontal, StatsAxis *xAxis, StatsAxis *yAxis); + void addHistogramMarker(double pos, QColor color, bool isHorizontal, StatsAxis *xAxis, StatsAxis *yAxis); StatsState state; QFont titleFont; @@ -157,7 +148,7 @@ private: std::unique_ptr<Legend> legend; std::vector<std::unique_ptr<QuartileMarker>> quartileMarkers; std::vector<RegressionLine> regressionLines; - std::vector<HistogramMarker> histogramMarkers; + std::vector<std::unique_ptr<HistogramMarker>> histogramMarkers; std::unique_ptr<QGraphicsSimpleTextItem> title; StatsSeries *highlightedSeries; StatsAxis *xAxis, *yAxis; |