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>
This commit is contained in:
Berthold Stoeger 2021-01-05 12:11:46 +01:00 committed by Dirk Hohndel
parent 598058e21e
commit 4ab9f1c6b0
15 changed files with 377 additions and 225 deletions

View file

@ -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);
}