diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-01-05 12:11:46 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-01-06 12:31:22 -0800 |
commit | 4ab9f1c6b06204285267e79b5ed993514e0213e2 (patch) | |
tree | 5e8e792ec76639b1493937d6401bb92d05dabb1c /stats/statsseries.cpp | |
parent | 598058e21ebc93834b71cc1b66e881451a596ce6 (diff) | |
download | subsurface-4ab9f1c6b06204285267e79b5ed993514e0213e2.tar.gz |
statistics: replace QtCharts' axes
Replace by custom implementation, with the ultimate goal to
remove the QtCharts module. This doesn't yet display axis
titles or a grid.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'stats/statsseries.cpp')
-rw-r--r-- | stats/statsseries.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/stats/statsseries.cpp b/stats/statsseries.cpp index 48b31336e..5996508a4 100644 --- a/stats/statsseries.cpp +++ b/stats/statsseries.cpp @@ -2,18 +2,17 @@ #include "statsseries.h" #include "statsaxis.h" -#include <QChart> - StatsSeries::StatsSeries(QtCharts::QChart *chart, StatsAxis *xAxis, StatsAxis *yAxis) : - xAxis(xAxis), yAxis(yAxis) + chart(chart), xAxis(xAxis), yAxis(yAxis) { - chart->addSeries(this); - if (xAxis && yAxis) { - attachAxis(xAxis->qaxis()); - attachAxis(yAxis->qaxis()); - } } StatsSeries::~StatsSeries() { } + +QPointF StatsSeries::toScreen(QPointF p) +{ + return xAxis && yAxis ? QPointF(xAxis->toScreen(p.x()), yAxis->toScreen(p.y())) + : QPointF(0.0, 0.0); +} |