mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
statistics: convert HistogramMarkers to QSGNodes
This is in analogy to the quartile markers. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
790d2b2ddb
commit
218c844ad4
6 changed files with 65 additions and 46 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue