From 4ab9f1c6b06204285267e79b5ed993514e0213e2 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 5 Jan 2021 12:11:46 +0100 Subject: 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 Signed-off-by: Dirk Hohndel --- stats/statsseries.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'stats/statsseries.cpp') 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 - 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); +} -- cgit v1.2.3-70-g09d2