mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-24 04:33:03 +03:00
Fix setting manual step to be float
This commit is contained in:
parent
c45aef0efd
commit
8135ca07cf
@ -805,9 +805,9 @@ void AbstractSeriesChart::updateMinAndMaxValues()
|
||||
}
|
||||
|
||||
qreal maxYValue = 0;
|
||||
qreal minYValue = 0;
|
||||
qreal minYValue = std::numeric_limits<qreal>::max();
|
||||
qreal maxXValue = 0;
|
||||
qreal minXValue = 0;
|
||||
qreal minXValue = std::numeric_limits<qreal>::max();
|
||||
|
||||
for (SeriesItem* series : m_chartItem->series()){
|
||||
for (qreal value : series->data()->values()){
|
||||
|
@ -132,7 +132,7 @@ void AxisData::calculateRoundedAxisScale()
|
||||
qreal temporaryMin = 0;
|
||||
qreal temporaryMax = 0;
|
||||
if (calculateMinimum) {
|
||||
temporaryMin = qMax(0.0, minValue());
|
||||
temporaryMin = qMin(0.0, minValue());
|
||||
} else {
|
||||
temporaryMin = qMin(manualMinimum(), minValue());
|
||||
}
|
||||
@ -214,7 +214,10 @@ void AxisData::calculateRoundedAxisScale()
|
||||
m_segmentCount = static_cast<int>(round((currentAxisMaximum - currentAxisMinimum) / m_step));
|
||||
m_rangeMin = currentAxisMinimum;
|
||||
m_rangeMax = currentAxisMaximum;
|
||||
isLoopFinished = m_segmentCount <= maximumSegmentCount;
|
||||
// Check also if step is correctly calucalted. It is possible for float steps that
|
||||
// there might be a difference. Recalculate the step in that case.
|
||||
const qreal tmpStep = (m_rangeMax - m_rangeMin) / m_segmentCount;
|
||||
isLoopFinished = m_segmentCount <= maximumSegmentCount && qFuzzyCompare(tmpStep, m_step);
|
||||
if (!isLoopFinished) {
|
||||
// Configured step may be invalid, calculating it automatically
|
||||
calculateStep = true;
|
||||
@ -224,8 +227,12 @@ void AxisData::calculateRoundedAxisScale()
|
||||
|
||||
void AxisData::calculateSimpleAxisScale()
|
||||
{
|
||||
qreal min = 0;
|
||||
if (m_minValue < 0) {
|
||||
min = minValue();
|
||||
}
|
||||
m_segmentCount = 4;
|
||||
const int delta = maxValue() - minValue();
|
||||
const int delta = maxValue() - min;
|
||||
int max = delta;
|
||||
while (max % m_segmentCount != 0){
|
||||
max++;
|
||||
|
Loading…
Reference in New Issue
Block a user