diff --git a/src/LTMPlot.cpp b/src/LTMPlot.cpp index aa5bbac38..38b36f4a4 100644 --- a/src/LTMPlot.cpp +++ b/src/LTMPlot.cpp @@ -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()); diff --git a/src/LTMSettings.h b/src/LTMSettings.h index 20177a902..87ef187ed 100644 --- a/src/LTMSettings.h +++ b/src/LTMSettings.h @@ -47,6 +47,7 @@ class RideMetric; #define LTM_MONTH 3 #define LTM_YEAR 4 #define LTM_TOD 5 +#define LTM_ALL 6 // type of metric #define METRIC_DB 1 diff --git a/src/LTMTool.cpp b/src/LTMTool.cpp index d29dfb134..e5312082b 100644 --- a/src/LTMTool.cpp +++ b/src/LTMTool.cpp @@ -89,6 +89,7 @@ LTMTool::LTMTool(Context *context, LTMSettings *settings) : QWidget(context->mai groupBy->addItem(tr("Months"), LTM_MONTH); groupBy->addItem(tr("Years"), LTM_YEAR); groupBy->addItem(tr("Time Of Day"), LTM_TOD); + groupBy->addItem(tr("All"), LTM_ALL); groupBy->setCurrentIndex(0); basicsettingsLayout->addRow(new QLabel(tr("Group by")), groupBy); basicsettingsLayout->addRow(new QLabel(tr(""))); // spacing diff --git a/src/LTMWindow.cpp b/src/LTMWindow.cpp index 72498b195..0bc1dfd7f 100644 --- a/src/LTMWindow.cpp +++ b/src/LTMWindow.cpp @@ -127,7 +127,8 @@ LTMWindow::LTMWindow(Context *context) : << tr("Weeks") << tr("Months") << tr("Years") - << tr("Time Of Day"); + << tr("Time Of Day") + << tr("All"); rGroupBy->setStrings(strings); rGroupBy->setValue(0); @@ -925,6 +926,9 @@ LTMWindow::refreshDataTable() case LTM_TOD : summary += tr("time of day"); break; + case LTM_ALL : + summary += tr("All"); + break; } summary += "

"; @@ -1072,8 +1076,10 @@ LTMWindow::refreshDataTable() // fill in the remainder if data doesn't extend to // the period we are summarising - for (int n=0; n < aggregates[0].x.count(); n++) { - aggregates[0].x[n] = n; + if (settings.groupBy != LTM_ALL) { + for (int n=0; n < aggregates[0].x.count(); n++) { + aggregates[0].x[n] = n; + } } // formatting ...