mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
23d781deba
commit
ccc95f938a
2 changed files with 4 additions and 1 deletions
|
@ -4,7 +4,8 @@
|
||||||
|
|
||||||
#include <QChart>
|
#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);
|
chart->addSeries(this);
|
||||||
if (xAxis && yAxis) {
|
if (xAxis && yAxis) {
|
||||||
|
|
|
@ -22,6 +22,8 @@ public:
|
||||||
virtual void updatePositions() = 0; // Called if chart geometry changes.
|
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 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.
|
virtual void unhighlight() = 0; // Unhighlight any highlighted item.
|
||||||
|
protected:
|
||||||
|
StatsAxis *xAxis, *yAxis; // May be zero for charts without axes (pie charts).
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue