⚡ Dynamic Plot DPI based on user's screen size
This commit is contained in:
parent
3a119a7d18
commit
36539b64b2
|
@ -28,6 +28,9 @@ class UserInterface(QMainWindow):
|
||||||
self.setMinimumWidth(1500)
|
self.setMinimumWidth(1500)
|
||||||
self.setMinimumHeight(500)
|
self.setMinimumHeight(500)
|
||||||
|
|
||||||
|
# Plot DPI Settings
|
||||||
|
self.plotDpi = screen_width / 20
|
||||||
|
|
||||||
# Layout boxes
|
# Layout boxes
|
||||||
self.header_box = QHBoxLayout()
|
self.header_box = QHBoxLayout()
|
||||||
h2box1 = QHBoxLayout()
|
h2box1 = QHBoxLayout()
|
||||||
|
@ -142,34 +145,38 @@ class UserInterface(QMainWindow):
|
||||||
self.graphBox.addWidget(self.graphPlaceHolder)
|
self.graphBox.addWidget(self.graphPlaceHolder)
|
||||||
|
|
||||||
if self.graphTypePicker.currentText() == 'Total Cases':
|
if self.graphTypePicker.currentText() == 'Total Cases':
|
||||||
casesGraphPath = self.analyser.getCasesGraph(country, startDate, endDate)
|
casesGraphPath = self.analyser.getCasesGraph(country, startDate, endDate, plotDpi=self.plotDpi)
|
||||||
self.graphPlaceHolder.setPixmap(QPixmap(casesGraphPath))
|
self.graphPlaceHolder.setPixmap(QPixmap(casesGraphPath))
|
||||||
elif self.graphTypePicker.currentText() == 'Case Increase':
|
elif self.graphTypePicker.currentText() == 'Case Increase':
|
||||||
caseIncreaseGraphPath = self.analyser.getCaseIncreaseGraph(country, startDate, endDate)
|
caseIncreaseGraphPath = self.analyser.getCaseIncreaseGraph(country, startDate, endDate,
|
||||||
|
plotDpi=self.plotDpi)
|
||||||
self.graphPlaceHolder.setPixmap(QPixmap(caseIncreaseGraphPath))
|
self.graphPlaceHolder.setPixmap(QPixmap(caseIncreaseGraphPath))
|
||||||
elif self.graphTypePicker.currentText() == 'Increase Percentage':
|
elif self.graphTypePicker.currentText() == 'Increase Percentage':
|
||||||
increasePercentageGraphPath = self.analyser.getIncreasePercentageGraph(country, startDate, endDate)
|
increasePercentageGraphPath = self.analyser.getIncreasePercentageGraph(country, startDate, endDate,
|
||||||
|
plotDpi=self.plotDpi)
|
||||||
self.graphPlaceHolder.setPixmap(QPixmap(increasePercentageGraphPath))
|
self.graphPlaceHolder.setPixmap(QPixmap(increasePercentageGraphPath))
|
||||||
elif self.graphTypePicker.currentText() == 'Total Deaths':
|
elif self.graphTypePicker.currentText() == 'Total Deaths':
|
||||||
deathGraphPath = self.analyser.getDeathGraph(country, startDate, endDate)
|
deathGraphPath = self.analyser.getDeathGraph(country, startDate, endDate, plotDpi=self.plotDpi)
|
||||||
self.graphPlaceHolder.setPixmap(QPixmap(deathGraphPath))
|
self.graphPlaceHolder.setPixmap(QPixmap(deathGraphPath))
|
||||||
elif self.graphTypePicker.currentText() == 'Death Increase':
|
elif self.graphTypePicker.currentText() == 'Death Increase':
|
||||||
deathIncreaseGraphPath = self.analyser.getDeathIncreaseGraph(country, startDate, endDate)
|
deathIncreaseGraphPath = self.analyser.getDeathIncreaseGraph(country, startDate, endDate,
|
||||||
|
plotDpi=self.plotDpi)
|
||||||
self.graphPlaceHolder.setPixmap(QPixmap(deathIncreaseGraphPath))
|
self.graphPlaceHolder.setPixmap(QPixmap(deathIncreaseGraphPath))
|
||||||
elif self.graphTypePicker.currentText() == 'Death Rate':
|
elif self.graphTypePicker.currentText() == 'Death Rate':
|
||||||
deathRateGraphPath = self.analyser.getDailyDeathRateGraph(country, startDate, endDate)
|
deathRateGraphPath = self.analyser.getDailyDeathRateGraph(country, startDate, endDate,
|
||||||
|
plotDpi=self.plotDpi)
|
||||||
self.graphPlaceHolder.setPixmap(QPixmap(deathRateGraphPath))
|
self.graphPlaceHolder.setPixmap(QPixmap(deathRateGraphPath))
|
||||||
elif self.graphTypePicker.currentText() == 'Is it going to end soon?':
|
elif self.graphTypePicker.currentText() == 'Is it going to end soon?':
|
||||||
isItOverGraphPath = self.analyser.getIsItOverGraph(country)
|
isItOverGraphPath = self.analyser.getIsItOverGraph(country, plotDpi=self.plotDpi)
|
||||||
self.graphPlaceHolder.setPixmap(QPixmap(isItOverGraphPath))
|
self.graphPlaceHolder.setPixmap(QPixmap(isItOverGraphPath))
|
||||||
elif self.graphTypePicker.currentText() == 'Cases per Million':
|
elif self.graphTypePicker.currentText() == 'Cases per Million':
|
||||||
casesPerMillionGraphPath = self.analyser.getCasesPerMillionGraph(country)
|
casesPerMillionGraphPath = self.analyser.getCasesPerMillionGraph(country, plotDpi=self.plotDpi)
|
||||||
self.graphPlaceHolder.setPixmap(QPixmap(casesPerMillionGraphPath))
|
self.graphPlaceHolder.setPixmap(QPixmap(casesPerMillionGraphPath))
|
||||||
elif self.graphTypePicker.currentText() == 'Deaths per Million':
|
elif self.graphTypePicker.currentText() == 'Deaths per Million':
|
||||||
deathsPerMillionGraphPath = self.analyser.getDeathsPerMillionGraph(country)
|
deathsPerMillionGraphPath = self.analyser.getDeathsPerMillionGraph(country, plotDpi=self.plotDpi)
|
||||||
self.graphPlaceHolder.setPixmap(QPixmap(deathsPerMillionGraphPath))
|
self.graphPlaceHolder.setPixmap(QPixmap(deathsPerMillionGraphPath))
|
||||||
elif self.graphTypePicker.currentText() == 'Double Rate Compare':
|
elif self.graphTypePicker.currentText() == 'Double Rate Compare':
|
||||||
doubleRateCompareGraphPath = self.analyser.getDoubleRateCompareGraph(country)
|
doubleRateCompareGraphPath = self.analyser.getDoubleRateCompareGraph(country, plotDpi=self.plotDpi)
|
||||||
self.graphPlaceHolder.setPixmap(QPixmap(doubleRateCompareGraphPath))
|
self.graphPlaceHolder.setPixmap(QPixmap(doubleRateCompareGraphPath))
|
||||||
|
|
||||||
def clearLayout(self, layout):
|
def clearLayout(self, layout):
|
||||||
|
|
207
statsfile.csv
207
statsfile.csv
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user