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

@ -167,8 +167,7 @@ PieSeries::~PieSeries()
void PieSeries::updatePositions()
{
QtCharts::QChart *c = chart();
QRectF plotRect = c->plotArea();
QRectF plotRect = chart->plotArea();
center = plotRect.center();
radius = std::min(plotRect.width(), plotRect.height()) * pieSize / 2.0;
QRectF rect(center.x() - radius, center.y() - radius, 2.0 * radius, 2.0 * radius);
@ -247,7 +246,7 @@ bool PieSeries::hover(QPointF pos)
if (highlighted >= 0 && highlighted < (int)items.size()) {
items[highlighted].highlight(highlighted, true, (int)items.size());
if (!information)
information.reset(new InformationBox(chart()));
information.reset(new InformationBox(chart));
information->setText(makeInfo(highlighted), pos);
} else {
information.reset();