From 7ba4077f9f83822468d1b3c191b470634a71dbd6 Mon Sep 17 00:00:00 2001 From: bgreman <47828384+bgreman@users.noreply.github.com> Date: Wed, 30 Jun 2021 23:50:02 -0400 Subject: [PATCH] Fixes #240 by making statistics windows axis labels integers (#1370) --- changelog.md | 1 + qt_ui/windows/stats/QAircraftChart.py | 6 ++++++ qt_ui/windows/stats/QArmorChart.py | 6 ++++++ qt_ui/windows/stats/QStatsWindow.py | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index fd71f412..53c138c3 100644 --- a/changelog.md +++ b/changelog.md @@ -17,6 +17,7 @@ Saves from 4.0.0 are compatible with 4.0.1. * **[UI]** Google search link added to unit information when there is no information provided. ## Fixes +* **[UI]** Statistics window tick marks are now always integers. # 4.0.0 diff --git a/qt_ui/windows/stats/QAircraftChart.py b/qt_ui/windows/stats/QAircraftChart.py index 6c8d1db9..6516ec58 100644 --- a/qt_ui/windows/stats/QAircraftChart.py +++ b/qt_ui/windows/stats/QAircraftChart.py @@ -42,10 +42,16 @@ class QAircraftChart(QFrame): self.chart.setTitle("Aircraft forces over time") self.chart.createDefaultAxes() + self.chart.axisX().setTitleText("Turn") + self.chart.axisX().setLabelFormat("%i") self.chart.axisX().setRange(0, len(self.alliedAircraft)) + self.chart.axisX().applyNiceNumbers() + + self.chart.axisY().setLabelFormat("%i") self.chart.axisY().setRange( 0, max(max(self.alliedAircraft), max(self.enemyAircraft)) + 10 ) + self.chart.axisY().applyNiceNumbers() self.chartView = QtCharts.QChartView(self.chart) self.chartView.setRenderHint(QPainter.Antialiasing) diff --git a/qt_ui/windows/stats/QArmorChart.py b/qt_ui/windows/stats/QArmorChart.py index 09c272fa..e952c717 100644 --- a/qt_ui/windows/stats/QArmorChart.py +++ b/qt_ui/windows/stats/QArmorChart.py @@ -42,10 +42,16 @@ class QArmorChart(QFrame): self.chart.setTitle("Combat vehicles over time") self.chart.createDefaultAxes() + self.chart.axisX().setTitleText("Turn") + self.chart.axisX().setLabelFormat("%i") self.chart.axisX().setRange(0, len(self.alliedArmor)) + self.chart.axisX().applyNiceNumbers() + + self.chart.axisY().setLabelFormat("%i") self.chart.axisY().setRange( 0, max(max(self.alliedArmor), max(self.enemyArmor)) + 10 ) + self.chart.axisY().applyNiceNumbers() self.chartView = QtCharts.QChartView(self.chart) self.chartView.setRenderHint(QPainter.Antialiasing) diff --git a/qt_ui/windows/stats/QStatsWindow.py b/qt_ui/windows/stats/QStatsWindow.py index 7d4fda07..14817d18 100644 --- a/qt_ui/windows/stats/QStatsWindow.py +++ b/qt_ui/windows/stats/QStatsWindow.py @@ -14,7 +14,7 @@ class QStatsWindow(QDialog): self.setModal(True) self.setWindowTitle("Stats") self.setWindowIcon(CONST.ICONS["Statistics"]) - self.setMinimumSize(600, 250) + self.setMinimumSize(600, 300) self.layout = QGridLayout() self.aircraft_charts = QAircraftChart(self.game)