mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Plot Cosmetics Update
Update to a number of plots to align with the flatter, less cluttered chart style used elsewhere (Ride, Histogram, CP et al). Changes made are purely cosmetic and apply to: * Aerolab * HrPw * Realtime, ErgFile * Weekly Summary
This commit is contained in:
@@ -243,6 +243,7 @@ Aerolab::Aerolab(
|
||||
|
||||
insertLegend(new QwtLegend(), QwtPlot::BottomLegend);
|
||||
setCanvasBackground(Qt::white);
|
||||
canvas()->setFrameStyle(QFrame::NoFrame);
|
||||
|
||||
setXTitle();
|
||||
setAxisTitle(yLeft, "Elevation (m)");
|
||||
|
||||
@@ -44,6 +44,7 @@ ErgFilePlot::ErgFilePlot(QList<ErgFilePoint> *data)
|
||||
|
||||
//insertLegend(new QwtLegend(), QwtPlot::BottomLegend);
|
||||
setCanvasBackground(Qt::white);
|
||||
canvas()->setFrameStyle(QFrame::NoFrame);
|
||||
courseData = data; // what we plot
|
||||
Now = 0; // where we are
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <qwt_data.h>
|
||||
#include <qwt_legend.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_plot_canvas.h>
|
||||
#include <qwt_plot_grid.h>
|
||||
#include <qwt_plot.h>
|
||||
#include <qwt_plot_marker.h>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <assert.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_plot_grid.h>
|
||||
#include <qwt_plot_canvas.h>
|
||||
#include <qwt_plot_marker.h>
|
||||
#include <qwt_text.h>
|
||||
#include <qwt_symbol.h>
|
||||
@@ -48,6 +49,7 @@ HrPwPlot::HrPwPlot(MainWindow *mainWindow, HrPwWindow *hrPwWindow) :
|
||||
unit(settings.value(GC_UNIT))
|
||||
{
|
||||
setCanvasBackground(Qt::white);
|
||||
canvas()->setFrameStyle(QFrame::NoFrame);
|
||||
setXTitle(); // Power (Watts)
|
||||
|
||||
// Linear Regression Curve
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <qwt_data.h>
|
||||
#include <qwt_legend.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_plot_canvas.h>
|
||||
#include <qwt_plot_grid.h>
|
||||
#include "RealtimePlot.h"
|
||||
#include "Colors.h"
|
||||
@@ -151,9 +152,24 @@ RealtimePlot::RealtimePlot() : pwrCurve(NULL)
|
||||
// lodCurve->setData(lodData);
|
||||
// lodCurve->attach(this);
|
||||
// lodCurve->setYAxis(QwtPlot::yLeft);
|
||||
canvas()->setFrameStyle(QFrame::NoFrame);
|
||||
configChanged(); // set colors
|
||||
}
|
||||
|
||||
void
|
||||
RealtimePlot::setAxisTitle(int axis, QString label)
|
||||
{
|
||||
// setup the default fonts
|
||||
QFont stGiles; // hoho - Chart Font St. Giles ... ok you have to be British to get this joke
|
||||
stGiles.fromString(appsettings->value(this, GC_FONT_CHARTLABELS, QFont().toString()).toString());
|
||||
stGiles.setPointSize(appsettings->value(NULL, GC_FONT_CHARTLABELS_SIZE, 8).toInt());
|
||||
|
||||
QwtText title(label);
|
||||
title.setFont(stGiles);
|
||||
QwtPlot::setAxisFont(axis, stGiles);
|
||||
QwtPlot::setAxisTitle(axis, title);
|
||||
}
|
||||
|
||||
void
|
||||
RealtimePlot::configChanged()
|
||||
{
|
||||
|
||||
@@ -167,6 +167,7 @@ class RealtimePlot : public QwtPlot
|
||||
#endif
|
||||
|
||||
public:
|
||||
void setAxisTitle(int axis, QString label);
|
||||
Realtime30PwrData pwr30Data;
|
||||
RealtimePwrData pwrData;
|
||||
RealtimeSpdData spdData;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_plot_canvas.h>
|
||||
#include <qwt_plot_grid.h>
|
||||
#include <qwt_plot_marker.h>
|
||||
#include <qwt_text.h>
|
||||
@@ -36,7 +37,8 @@ static double inline max(double a, double b) { if (a > b) return a; else return
|
||||
|
||||
SmallPlot::SmallPlot(QWidget *parent) : QwtPlot(parent), d_mrk(NULL), smooth(30)
|
||||
{
|
||||
setCanvasBackground(GColor(CRIDEPLOTBACKGROUND));
|
||||
setCanvasBackground(GColor(CPLOTBACKGROUND));
|
||||
canvas()->setFrameStyle(QFrame::NoFrame);
|
||||
|
||||
setXTitle();
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <QtGui>
|
||||
#include <qwt_plot.h>
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_plot_canvas.h>
|
||||
#include <qwt_plot_grid.h>
|
||||
#include <assert.h>
|
||||
|
||||
@@ -51,6 +52,8 @@ WeeklySummaryWindow::WeeklySummaryWindow(bool useMetricUnits,
|
||||
weeklyPlot->setAxisFont(QwtPlot::xBottom, weeklyPlotAxisFont);
|
||||
weeklyPlot->setAxisFont(QwtPlot::yLeft, weeklyPlotAxisFont);
|
||||
weeklyPlot->setAxisFont(QwtPlot::yRight, weeklyPlotAxisFont);
|
||||
weeklyPlot->canvas()->setFrameStyle(QFrame::NoFrame);
|
||||
weeklyPlot->setCanvasBackground(Qt::white);
|
||||
|
||||
weeklyDistCurve = new QwtPlotCurve();
|
||||
weeklyDistCurve->setStyle(QwtPlotCurve::Steps);
|
||||
@@ -79,6 +82,8 @@ WeeklySummaryWindow::WeeklySummaryWindow(bool useMetricUnits,
|
||||
weeklyBSPlot->setAxisFont(QwtPlot::xBottom, weeklyPlotAxisFont);
|
||||
weeklyBSPlot->setAxisFont(QwtPlot::yLeft, weeklyPlotAxisFont);
|
||||
weeklyBSPlot->setAxisFont(QwtPlot::yRight, weeklyPlotAxisFont);
|
||||
weeklyBSPlot->canvas()->setFrameStyle(QFrame::NoFrame);
|
||||
weeklyBSPlot->setCanvasBackground(Qt::white);
|
||||
|
||||
weeklyBSCurve = new QwtPlotCurve();
|
||||
weeklyBSCurve->setStyle(QwtPlotCurve::Steps);
|
||||
@@ -121,6 +126,11 @@ WeeklySummaryWindow::WeeklySummaryWindow(bool useMetricUnits,
|
||||
|
||||
weeklySummary = new QTextEdit;
|
||||
weeklySummary->setReadOnly(true);
|
||||
weeklySummary->setStyleSheet("QTextEdit { border: 0px}");
|
||||
|
||||
QFont defaultFont; // mainwindow sets up the defaults.. we need to apply
|
||||
defaultFont.setPointSize(defaultFont.pointSize()-2);
|
||||
weeklySummary->setFont(defaultFont);
|
||||
|
||||
glayout->addWidget(weeklySummary,0,0,1,-1); // row, col, rowspan, colspan. -1 == fill to edge
|
||||
glayout->addWidget(weeklyPlot,1,0);
|
||||
@@ -275,8 +285,8 @@ WeeklySummaryWindow::refresh()
|
||||
QString summary;
|
||||
summary = tr(
|
||||
"<center>"
|
||||
"<h2>Week of %1 through %2</h2>"
|
||||
"<h2>Summary</h2>"
|
||||
"<h3>Week of %1 through %2</h3>"
|
||||
"<h3>Summary</h3>"
|
||||
"<p>"
|
||||
"<table align=\"center\" width=\"60%\" border=0>"
|
||||
"<tr><td>Total time riding:</td>"
|
||||
@@ -312,13 +322,13 @@ WeeklySummaryWindow::refresh()
|
||||
.arg(weeklyRI, 0, 'f', 3);
|
||||
|
||||
if (zone_range >= 0) {
|
||||
summary += tr( "</table>" "<h2>Power Zones</h2>");
|
||||
summary += tr( "</table>" "<h3>Power Zones</h3>");
|
||||
summary += mainWindow->zones()->summarize(zone_range, time_in_zone);
|
||||
} else {
|
||||
summary += "No zones configured - zone summary not available.";
|
||||
}
|
||||
if (hrzone_range >= 0) {
|
||||
summary += tr( "</table>" "<h2>Heart Rate Zones</h2>");
|
||||
summary += tr( "</table>" "<h3>Heart Rate Zones</h3>");
|
||||
summary += mainWindow->hrZones()->summarize(hrzone_range, time_in_hrzone);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user