diff --git a/limereport/items/charts/lrverticalbarchart.cpp b/limereport/items/charts/lrverticalbarchart.cpp index 36109b0..bccc244 100644 --- a/limereport/items/charts/lrverticalbarchart.cpp +++ b/limereport/items/charts/lrverticalbarchart.cpp @@ -71,8 +71,6 @@ void VerticalBarChart::paintVerticalBars(QPainter *painter, QRectF barsRect) qreal hStep = (barsRect.width() / valuesCount()) / (barSeriesCount == 0 ? 1 : barSeriesCount); qreal topShift = (delta - (maxValue() - minValue())) * vStep + barsRect.top(); - qDebug() << "vStep" << vStep << "hStep" << hStep; - if (!m_chartItem->series().isEmpty() && (m_chartItem->itemMode() != DesignMode)){ int curSeries = 0; foreach (SeriesItem* series, m_chartItem->series()) { diff --git a/limereport/items/lrchartaxiseditor.cpp b/limereport/items/lrchartaxiseditor.cpp index 90b1dbd..f5d06fd 100644 --- a/limereport/items/lrchartaxiseditor.cpp +++ b/limereport/items/lrchartaxiseditor.cpp @@ -3,6 +3,8 @@ #include "ui_lrchartaxiseditor.h" #include "lraxisdata.h" +#include "lrbasedesignintf.h" + ChartAxisEditor::ChartAxisEditor(LimeReport::ChartItem *item, LimeReport::PageDesignIntf *page, bool isXAxis, QSettings *settings, QWidget *parent): QWidget(parent), ui(new Ui::ChartAxisEditor), m_chartItem(item), m_page(page), m_settings(settings), m_isXAxis(isXAxis) @@ -59,9 +61,9 @@ void ChartAxisEditor::init() LimeReport::AxisData *axisData = m_isXAxis ? m_chartItem->xAxisData() : m_chartItem->yAxisData(); - ui->minimumSpinBox->setValue(axisData->rangeMin()); - ui->maximumSpinBox->setValue(axisData->rangeMax()); - ui->stepSpinBox->setValue(axisData->step()); + ui->minimumSpinBox->setValue(axisData->manualMinimum()); + ui->maximumSpinBox->setValue(axisData->manualMaximum()); + ui->stepSpinBox->setValue(axisData->manualStep()); ui->minimumCheckBox->setChecked(axisData->isMinimumAutomatic()); ui->maximumCheckBox->setChecked(axisData->isMaximumAutomatic()); @@ -108,7 +110,11 @@ void ChartAxisEditor::on_pushButtonOk_clicked() axisData->setCalculateAxisScale(ui->enableScaleCalculation_checkbox->isChecked()); - axisData->update(); + if (m_chartItem->itemMode() == LimeReport::DesignMode) { + axisData->updateForDesignMode(); + } else { + axisData->update(); + } close(); } diff --git a/limereport/lraxisdata.cpp b/limereport/lraxisdata.cpp index bf480ad..e429583 100644 --- a/limereport/lraxisdata.cpp +++ b/limereport/lraxisdata.cpp @@ -50,6 +50,17 @@ void AxisData::update() calculateSimpleAxisScale(); } m_delta = m_step * m_segmentCount; + + // Update manual values if they are automatic + if (m_isStepAutomatic) { + m_manualStep = m_step; + } + if (m_isMinimumAutomatic) { + m_manualMinimum = m_rangeMin; + } + if (m_isMaximumAutomatic) { + m_manualMaximum = m_rangeMax; + } } void AxisData::update(qreal minValue, qreal maxValue) diff --git a/limereport/lraxisdata.h b/limereport/lraxisdata.h index 99a8a13..66c63a1 100644 --- a/limereport/lraxisdata.h +++ b/limereport/lraxisdata.h @@ -18,6 +18,7 @@ class AxisData : public QObject public: AxisData(QObject *parent = nullptr); + QString toString() const; void copy(AxisData *other); void update(); void update(qreal minValue, qreal maxValue);