mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
statistics: fix display of month on continuous axis
tm::tm_mon is 0..11, not 1..12, so we have to add one for display. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
7d366b9afe
commit
48659c3f7d
2 changed files with 2 additions and 2 deletions
|
@ -630,7 +630,7 @@ static std::vector<HistogramAxisEntry> timeRangeToBins(double from, double to)
|
|||
} else if (act[2] == 0) {
|
||||
res.push_back({ monthname(act[1]), val, true });
|
||||
} else {
|
||||
QString s = format.arg(QString::number(act[2]), sep, QString::number(act[1]));
|
||||
QString s = format.arg(QString::number(act[2]), sep, QString::number(act[1] + 1));
|
||||
res.push_back({s, val, true });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -924,7 +924,7 @@ struct DateMonthBinner : public SimpleContinuousBinner<DateMonthBinner, DateMont
|
|||
year_month value = derived_bin(bin).value;
|
||||
return QString("%1 %2").arg(monthname(value.second), QString::number(value.first));
|
||||
}
|
||||
// In histograms, output year for fill years, month otherwise
|
||||
// In histograms, output year for full years, month otherwise
|
||||
QString formatLowerBound(const StatsBin &bin) const override {
|
||||
year_month value = derived_bin(bin).value;
|
||||
return value.second == 0 ? QString::number(value.first)
|
||||
|
|
Loading…
Reference in a new issue