statistics: save axis with series

In the future we want to use our own axis implementation to
convert from/to screen coordinates. For this purpose, we
need to save the axes with the series. Especially if we want
to support multiple series on different axes.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-04 20:34:44 +01:00 committed by Dirk Hohndel
parent 23d781deba
commit ccc95f938a
2 changed files with 4 additions and 1 deletions

View file

@ -4,7 +4,8 @@
#include <QChart>
StatsSeries::StatsSeries(QtCharts::QChart *chart, StatsAxis *xAxis, StatsAxis *yAxis)
StatsSeries::StatsSeries(QtCharts::QChart *chart, StatsAxis *xAxis, StatsAxis *yAxis) :
xAxis(xAxis), yAxis(yAxis)
{
chart->addSeries(this);
if (xAxis && yAxis) {

View file

@ -22,6 +22,8 @@ public:
virtual void updatePositions() = 0; // Called if chart geometry changes.
virtual bool hover(QPointF pos) = 0; // Called on mouse movement. Return true if an item of this series is highlighted.
virtual void unhighlight() = 0; // Unhighlight any highlighted item.
protected:
StatsAxis *xAxis, *yAxis; // May be zero for charts without axes (pie charts).
};
#endif