Fixes #240 by making statistics windows axis labels integers (#1370)

This commit is contained in:
bgreman 2021-06-30 23:50:02 -04:00 committed by GitHub
parent 151f8bf329
commit 7ba4077f9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 1 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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)