Add Group By ALL to LTM

.. can see the total / average or bests for the date range selected

NOTE: Data Table mode is currently a bit broken .. need to revisit it
      and fix it up, not just for ALL mode but also for Estimates
This commit is contained in:
Mark Liversedge
2014-06-19 10:40:48 +01:00
parent 21232465be
commit c94b7a5bb2
4 changed files with 18 additions and 4 deletions

View File

@@ -1319,6 +1319,9 @@ LTMPlot::setCompareData(LTMSettings *set)
case LTM_YEAR:
setAxisTitle(xBottom, tr("Year"));
break;
case LTM_ALL:
setAxisTitle(xBottom, tr("All"));
break;
default:
setAxisTitle(xBottom, tr("Date"));
break;
@@ -2716,6 +2719,7 @@ LTMPlot::groupForDate(QDate date, int groupby)
case LTM_DAY:
default:
return date.toJulianDay();
case LTM_ALL: return 1;
}
}
@@ -2737,7 +2741,9 @@ LTMPlot::pointHover(QwtPlotCurve *curve, int index)
LTMScaleDraw *lsd = new LTMScaleDraw(settings->start, groupForDate(settings->start.date(), settings->groupBy), settings->groupBy);
QwtText startText = lsd->label((int)(curve->sample(index).x()+0.5));
if (settings->groupBy != LTM_WEEK)
if (settings->groupBy == LTM_ALL)
datestr = QString(tr("All"));
else if (settings->groupBy != LTM_WEEK)
datestr = startText.text();
else
datestr = QString(tr("Week Commencing %1")).arg(startText.text());