On the ride plot, the range of speed is typically much smaller than the ranges of power, heart rate, and cadence. As a result, for many activities it's difficult to distinguish much difference.

This update changes the plot to use a right y axis for speed. This makes it easier to see speed differences.

Some other packages use separate y axes for each data type, but as far as I can tell, this is not available with the qwt library used by GC.

   --jtc
This commit is contained in:
Robert Carlsen
2009-01-03 07:13:45 +00:00
parent baaacda681
commit c11b305239

View File

@@ -58,6 +58,7 @@ AllPlot::AllPlot() :
speedCurve = new QwtPlotCurve("Speed");
// speedCurve->setRenderHint(QwtPlotItem::RenderAntialiased);
speedCurve->setPen(QPen(Qt::green));
speedCurve->setYAxis(yRight);
speedCurve->attach(this);
cadCurve = new QwtPlotCurve("Cadence");
@@ -209,17 +210,15 @@ AllPlot::setYMax()
ymax = max(ymax, hrCurve->maxYValue());
ylabel += QString((ylabel == "") ? "" : " / ") + "BPM";
}
if (speedCurve->isVisible()) {
ymax = max(ymax, speedCurve->maxYValue());
ylabel += QString((ylabel == "") ? "" : " / ") +
QString((unit.toString() == "Metric") ? "KPH" : "MPH");
}
if (cadCurve->isVisible()) {
ymax = max(ymax, cadCurve->maxYValue());
ylabel += QString((ylabel == "") ? "" : " / ") + "RPM";
}
setAxisScale(yLeft, 0.0, ymax * 1.1);
setAxisTitle(yLeft, ylabel);
enableAxis(yRight, speedCurve->isVisible());
setAxisTitle(yRight, ((unit.toString() == "Metric") ? "KPH" : "MPH"));
}
void