From 7a4b3646e3c53a792e1430a5023e4f8e413c7f52 Mon Sep 17 00:00:00 2001 From: Emil Sawicki Date: Thu, 27 Jan 2022 19:57:53 +0100 Subject: [PATCH] Update code --- limereport/items/charts/lrlineschart.cpp | 7 +------ limereport/lraxisdata.cpp | 10 ---------- limereport/lraxisdata.h | 4 ---- limereport/objectinspector/lrobjectitemmodel.cpp | 2 ++ 4 files changed, 3 insertions(+), 20 deletions(-) diff --git a/limereport/items/charts/lrlineschart.cpp b/limereport/items/charts/lrlineschart.cpp index 01da6b0..36aabc6 100644 --- a/limereport/items/charts/lrlineschart.cpp +++ b/limereport/items/charts/lrlineschart.cpp @@ -70,12 +70,7 @@ void LinesChart::drawDesignMode(QPainter* painter, qreal hStep, qreal vStep, qre qreal LinesChart::calculatePos(const AxisData &data, qreal value, qreal rectSize) const { - if (data.reverseDirection() && data.rangeMin() >= 0) { - // Not flipping for minimum less than 0 because lower number is at the bottom. - return (1 - (data.rangeMax() - value) / data.delta()) * rectSize; - } else { - return (data.rangeMax() - value) / data.delta() * rectSize; - } + return (data.rangeMax() - value) / data.delta() * rectSize; } void LinesChart::paintSeries(QPainter *painter, SeriesItem *series, QRectF barsRect) diff --git a/limereport/lraxisdata.cpp b/limereport/lraxisdata.cpp index 34ef9e9..fbe7f2a 100644 --- a/limereport/lraxisdata.cpp +++ b/limereport/lraxisdata.cpp @@ -53,16 +53,6 @@ qreal AxisData::delta() const return m_delta; } -bool AxisData::reverseDirection() const -{ - return m_reverseDirection; -} - -void AxisData::setReverseDirection(bool reverseDirection) -{ - m_reverseDirection = reverseDirection; -} - void AxisData::calculateValuesAboveMax(qreal minValue, qreal maxValue, int segments) { const int delta = maxValue - minValue; diff --git a/limereport/lraxisdata.h b/limereport/lraxisdata.h index f69d72d..820eeb1 100644 --- a/limereport/lraxisdata.h +++ b/limereport/lraxisdata.h @@ -21,9 +21,6 @@ public: qreal delta() const; - bool reverseDirection() const; - void setReverseDirection(bool reverseDirection); - private: void calculateValuesAboveMax(qreal minValue, qreal maxValue, int segments); @@ -34,7 +31,6 @@ private: qreal m_step; qreal m_delta; int m_segmentCount; - bool m_reverseDirection; }; }; diff --git a/limereport/objectinspector/lrobjectitemmodel.cpp b/limereport/objectinspector/lrobjectitemmodel.cpp index cb5c2b6..122a921 100644 --- a/limereport/objectinspector/lrobjectitemmodel.cpp +++ b/limereport/objectinspector/lrobjectitemmodel.cpp @@ -171,6 +171,8 @@ void QObjectPropertyModel::translatePropertyName() tr("removeGap"); tr("dropPrinterMargins"); tr("notPrintIfEmpty"); + tr("gridChartLines"); + tr("horizontalAxisOnTop"); tr("mixWithPriorPage"); }