mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
statistics: add enough entries for date axis
We must add one more entries than there are days, because the entries describe the values between histograms. The root cause of the problem here is that a histogram axis is misused for a continuous day-axis. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
48659c3f7d
commit
56c91a46b6
2 changed files with 6 additions and 1 deletions
|
@ -623,7 +623,9 @@ static std::vector<HistogramAxisEntry> timeRangeToBins(double from, double to)
|
|||
QString format = day_before_month ? QStringLiteral("%1%2%3")
|
||||
: QStringLiteral("%3%2%1");
|
||||
QString sep = QString(separator);
|
||||
for (auto act = day_from; act < day_to; inc(act)) {
|
||||
// Attention: In a histogramm axis, we must add one more entries than
|
||||
// histogram bins. The entries are the values *between* the histograms.
|
||||
for (auto act = day_from; act <= day_to; inc(act)) {
|
||||
double val = date_to_double(act[0], act[1], act[2]);
|
||||
if (act[1] == 0) {
|
||||
res.push_back({ QString::number(act[0]), val, true });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue