aboutsummaryrefslogtreecommitdiff
path: root/barchart.h
diff options
context:
space:
mode:
Diffstat (limited to 'barchart.h')
-rw-r--r--barchart.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/barchart.h b/barchart.h
index 933c004..2d37419 100644
--- a/barchart.h
+++ b/barchart.h
@@ -7,6 +7,7 @@
#include <armadillo>
+#include "colorscale.h"
#include "scale.h"
class BarChart
@@ -19,9 +20,11 @@ public:
signals:
void valuesChanged(const arma::vec &values) const;
+ void colorScaleChanged(const ColorScale *scale) const;
public slots:
void setValues(const arma::vec &values);
+ void setColorScale(const ColorScale *scale);
protected:
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *);
@@ -31,10 +34,12 @@ protected:
private:
QSGNode *newBarNode() const;
void updateBarNodeGeom(QSGNode *barNode, float x, float width, float height);
+ void updateBarNodeColor(QSGNode *barNode, const QColor &color);
void updateBars(QSGNode *root);
bool m_shouldUpdateBars;
arma::vec m_values;
+ const ColorScale *m_colorScale;
std::vector<int> m_originalIndices;
LinearScale<float> m_scale;
};