summaryrefslogtreecommitdiffstats
path: root/stats/chartitem.h
diff options
context:
space:
mode:
Diffstat (limited to 'stats/chartitem.h')
-rw-r--r--stats/chartitem.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/stats/chartitem.h b/stats/chartitem.h
index a87d5fe10..650c45d53 100644
--- a/stats/chartitem.h
+++ b/stats/chartitem.h
@@ -123,7 +123,7 @@ public:
void setRect(const QRectF &rect);
QRectF getRect() const;
void render() override; // Only call on render thread!
-private:
+protected:
QColor color, borderColor;
double borderWidth;
QRectF rect;
@@ -135,6 +135,22 @@ private:
std::unique_ptr<QSGGeometry> borderGeometry;
};
+// A box-and-whiskers item. This is a bit lazy: derive from the bar item and add whiskers.
+class ChartBoxItem : public ChartBarItem {
+public:
+ ChartBoxItem(StatsView &v, ChartZValue z, double borderWidth);
+ ~ChartBoxItem();
+ void setBox(const QRectF &rect, double min, double max, double median); // The rect describes Q1, Q3.
+ QRectF getRect() const; // Note: this extends the center rectangle to include the whiskers.
+ void render() override; // Only call on render thread!
+private:
+ double min, max, median;
+ std::unique_ptr<QSGGeometryNode> whiskersNode;
+ std::unique_ptr<QSGFlatColorMaterial> whiskersMaterial;
+ std::unique_ptr<QSGGeometry> whiskersGeometry;
+};
+
+
// Implementation detail of templates - move to serparate header file
template <typename Node>
void HideableChartItem<Node>::setVisible(bool visibleIn)