mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Show Heat - sometimes wrong scale
... set YAxis scale ... set more specific YAxis texts (Percent of Best / Heat) ... Adjust Unit in Heat Hover
This commit is contained in:
@@ -468,9 +468,16 @@ CPPlot::plotModel()
|
||||
|
||||
heatCurve->setSamples(time, heat);
|
||||
heatCurve->setYAxis(yRight);
|
||||
setAxisScale(yRight, 0, 100); // fine if only heat is shown and percentage Scale will be fixed if shown
|
||||
if (showPercent) setAxisTitle(yRight, tr("Percent of Best / Heat Rides"));
|
||||
else setAxisTitle(yRight, tr("Heat Rides"));
|
||||
heatCurve->attach(this);
|
||||
}
|
||||
|
||||
setAxisVisible(yRight, showHeat || (showPercent && rideCurve));
|
||||
|
||||
// setAxisVisible(yRight, showHeat || showPercent);
|
||||
|
||||
//
|
||||
// HEAT AGE
|
||||
//
|
||||
@@ -1003,12 +1010,19 @@ CPPlot::plotRide(RideItem *rideItem)
|
||||
else max = max * 1.05f;
|
||||
setAxisScale(yRight, 0, max); // always 100
|
||||
|
||||
// set the right titles in case both Heat and Percent of best is show
|
||||
if (showHeat) setAxisTitle(yRight, tr("Percent of Best / Heat Rides"));
|
||||
else setAxisTitle(yRight, tr("Percent of Best"));
|
||||
|
||||
} else {
|
||||
|
||||
// JUST A NORMAL CURVE
|
||||
rideCurve->setYAxis(yLeft);
|
||||
rideCurve->setSamples(timeArray.data() + 1, rideCache->meanMaxArray(rideSeries).constData() + 1,
|
||||
maxNonZero > 0 ? maxNonZero-1 : 0);
|
||||
|
||||
// Set the YAxis Title if Heat is active
|
||||
if (showHeat) setAxisTitle(yRight, tr("Heat Rides"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1129,7 +1143,7 @@ CPPlot::pointHover(QwtPlotCurve *curve, int index)
|
||||
int index = xvalue * 60;
|
||||
if (index >= 0 && bestsCache && getBests().count() > index) {
|
||||
QDate date = getBestDates()[index];
|
||||
dateStr = date.toString("\nddd, dd MMM yyyy");
|
||||
dateStr = date.toString(tr("\nddd, dd MMM yyyy"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1139,6 +1153,9 @@ CPPlot::pointHover(QwtPlotCurve *curve, int index)
|
||||
|| (curve == rideCurve && showPercent)) units = QString("%");
|
||||
else units = RideFile::unitName(rideSeries, context);
|
||||
|
||||
// no units for Heat Curve
|
||||
if (curve == heatCurve) units = QString(tr("Rides"));
|
||||
|
||||
// output the tooltip
|
||||
text = QString("%1\n%3 %4%5")
|
||||
.arg(interval_to_str(60.0*xvalue))
|
||||
|
||||
Reference in New Issue
Block a user